Putting up graphic from directory to axes
Putting up graphic from directory to axes
(OP)
Dear everyone,
I am new to matlab so I hope that I can get some guidance from you guys. I am now using matlab version 6 to do a GUI. All I need to do is to select a name in the popup menu and the graphic can display on the axes from my C drive where I stall my picture. Hope that I can hear from you guys soon.
Thank a million
Lina
I am new to matlab so I hope that I can get some guidance from you guys. I am now using matlab version 6 to do a GUI. All I need to do is to select a name in the popup menu and the graphic can display on the axes from my C drive where I stall my picture. Hope that I can hear from you guys soon.
Thank a million
Lina





RE: Putting up graphic from directory to axes
Here is what you have to do:
1) Allow the user to select a file of a given type and catch the name and directory using 'uigetfile' Matlab GUI. The command is for example:
[FILENAME, PATHNAME] = UIGETFILE('*.tif', 'Choose image')
2) Load the image into a matrix using 'imread' Matlab function:
M=imread([PATHNAME '\' FILENAME],'jpg') ;
M can be a structure with two fields (Intensity and colorspec) or 3D matrix depends on the image type. Chack it yourself.
or
[M,C]=imread([PATHNAME '\' FILENAME],'tif') ; to get the intensity and colorspec in two different matrices. Check the help.
3) display the image using 'imshow' command:
imshow(M,C)
or
imshow(M.data,M.color)
or
imshow(M,[])
depends on image type.
put all this in a script file' My_first_try.m' for example.
See:
>> help uigetfile
>>help imread
>> help imshow
for details.
Joe
BSTEX-Equation viewer for Matlab
http://www.geocities.com/bstex2001
RE: Putting up graphic from directory to axes
I've just designed a GUI in Matlab V6.01 to simulate a simulink model. I'm having the trouble of showing the graphics on the axes of the GUI when i press the start button on the GUI. In short, how can I program the GUI to show the graph as it can be shown by the scope in Simulink?
thanks, Kirby