|
|
matlab gui #5
Hi,
I have a problem with accessing image in my simple GUI.
I have got two buttons:
button1:
I load an image - works fine.
[filename, pathname] = uigetfile('*.jpg', 'Pick an M-file');
ImOriginal = fullfile(pathname, filename);
imshow(ImOriginal),
button2:
I want to work with the image. Doesn't work, in button2 Matlab doesn't know ImOriginal.
Please help,
I know it is something with handles, but I can't figure it out.
Thank you very very much,
stepan
|
|
0
|
|
|
|
Reply
|
stepan
|
3/28/2011 8:16:01 PM |
|
"stepan" <user@compgroups.net/> wrote in message
news:rbednSVVZpAccQ3QnZ2dnUVZ_t2dnZ2d@giganews.com...
> Hi,
>
> I have a problem with accessing image in my simple GUI.
> I have got two buttons:
>
> button1:
> I load an image - works fine.
>
> [filename, pathname] = uigetfile('*.jpg', 'Pick an M-file');
> ImOriginal = fullfile(pathname, filename);
> imshow(ImOriginal),
>
> button2:
> I want to work with the image. Doesn't work, in button2 Matlab doesn't
> know ImOriginal.
That's correct. The variable ImOriginal lives in the workspace of button1's
callback function; when that function finishes executing, all variables that
live in that workspace are destroyed.
> Please help,
> I know it is something with handles, but I can't figure it out.
If you're creating the GUI using GUIDE, refer to this section of the
documentation for a description of some of the techniques you can use to
share data among your callback functions.
http://www.mathworks.com/help/techdoc/creating_guis/f5-998197.html
If you're creating your GUI programmatically, the appropriate section of the
documentation is:
http://www.mathworks.com/help/techdoc/creating_guis/f13-998197.html
--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
|
|
0
|
|
|
|
Reply
|
Steven_Lord
|
3/28/2011 8:43:46 PM
|
|
|
1 Replies
485 Views
(page loaded in 0.026 seconds)
Similiar Articles: Matlab GUI: displaying a vector in an edit text box - comp.soft ...I'm writing a GUI that serves to write data to a robot. The robot takes vectors of 11 elements. Once the user puts his vector in the edit text box, I ... Matlab GUI issues with R2007a - comp.soft-sys.matlabI am having a problem with Matlab GUI on R2007a that I cannot find a solution for online. Hopefully somebody here can help. The program has been r... Matlab GUI bar graph with different colors and stacked - comp.soft ...I am creating a GUI in Matlab. Details: 1) All matrices are made up of 0s and 1s 2) First matrix is 1X20 and plots black bars 3) Arbitrary num... Image Loading MatLAB GUI - comp.soft-sys.matlabI'm loading a Image to MatLAB GUI (axes) by using following command loadImage = importdata([pathname,'/',filename]); axis auto ; axes(handles.axe... Matlab GUI: displaying a Transfer Function in a static text box ...I want to display a tranfer function in a static text box. In my first attempt I coded everything and that worked fine but is sometimes difficult to ... Compiled Matlab GUI code starts up too slow... - comp.soft-sys ...I made a GUI program, and trying Matlab compiler to make it a standalone program. I am happy that I was able to make an excutable file, and have it r... How can i define global variable in matlab gui? - comp.soft-sys ...I'm an old C# user and new matlab gui user.I can define a global variable easily in C# which can be recognized by all program not one function. I hav... GUI, interuption while loop - comp.soft-sys.matlabHi all, in GUI, I try to interuption for while loop...let's say.. a program initiate while loop when button A are pushed, and i want to stop/in... Opening a Image in MatLAB GUI - comp.soft-sys.matlabIf I open a Image in MatLAB GUI say for example the resolution is (2000 x 1500) it fit to the axes correctly Then after If I open another Image which... Radio button in MATLAB GUI - comp.soft-sys.matlabHello, I am using two radio buttons,say button1 and button2, to prompt the user to select one. I have to process the value of the radio button, as ... Designing GUI in Matlab - Edward Sazonov: Home PageBuilding GUI interfaces in Matlab . MATLAB This example shows how to build user GUI in Matlab. We will build a simple ... Matlab GUI - TutorialsIn this series of articles, we are going to develop several Matlab GUI (or graphical user interfaces). We explain callback-functions and relevant instructions to ... 7/26/2012 3:40:22 PM
|
|
|
|
|
|
|
|
|