DSPRelated.com
Forums

GUI's Axes and passing Variables

Started by wiljerin May 22, 2003
Hi ladies and gentlemen:
Yesterday I asked some doubts. Thanks for those who answered but I
still have the same problem and I don't know if my Matlab is a bit
damaged (java exceptions, out of memory,etc...) or I'm a little
dummy with this.

1) The code I use to put an image into the axes created on the GUI
window (Tag: axes1) is:

setlogo(handles.axes1);

where:

function setlogo(ax)

set(gcf,'CurrentAxes',ax);
A = imread('desert_800.jpg','JPG');
image(A);

MATLAB says: ??? Error using ==> set Axes must be an existing child
of figure. ??

I also tried with:

axes(handles.axes1)
[X1,map1]=imread('desert_800.jpg');
imshow(X1,map1);

and also with (this is the same as the other one)

axes(handles.axes1);
A = imread('desert_800.jpg','JPG');
image(A);

The two last cases opens a different window. I can't show an image
or a plot over the axes. I get always the same message: Error using
set --> Axes must be a child figure.

if someone knows how, please inform me, i'm getting crazy. 2) Passing variables from one GUI to another.

There's a push_button that accedes the next block called:
codificacion_canal. I want to pass the

variable "trama" to it from the current gui. And then from this last
block pass two variables to

another one called: modul.

I've tried putting global variables.

function varargout= bloque_fuente(varargin)
% BLOQUE_FUENTE Application M-file for bloque_fuente.fig
% FIG = BLOQUE_FUENTE launch bloque_fuente GUI.
% BLOQUE_FUENTE('callback_name', ...) invoke the named callback.

function varargout = continuar_Callback(h, eventdata, handles,
varargin)

global trama;
codificacion_canal(trama);

But it doesn't work. Thanks beforehand.
greetings,
Will