Halo, guys. Sejujurnya aku baru kali ini cobain matlab. Huhuuu memalukan ga sih, nggak aja lah ya, anak ekonomi juga pasti banyak yang belum coba matlab hhhaaa watdezig gue kan if.
Oke, kali ini aku akan ngasih kalian tutorial very very very easy and simple. How to browse and show image using matlab.
- Kita gunakan guide ya guys
- Atur tampilannya jadi semacam gini:
- Jangan lupa kasih tag ya
Button : ambil
Axis : img_display - Save
- Nah cari function ambil callback di editor ya
- Masukin syntax ini:
function ambil_Callback(hObject, eventdata, handles)
% hObject handle to ambil (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename, pathname] = uigetfile({'*.bmp';'*.jpg';'*.gif';'*.*'}, 'Pick an Image File');
img=imread([pathname,filename]);
set(handles.edit1,'String',[pathname,filename]);
axes(handles.img_display);
imagesc(img);
set(handles.img_display,'Visible','off');
guidata(hObject, handles); - Taraaaaa, hasilnya jadi gini gengs, gampang kan?
0 Comments