×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Putting up graphic from directory to axes

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

RE: Putting up graphic from directory to axes

Hi,
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

hi joe,
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources