Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!d15g2000prc.googlegroups.com!not-for-mail
From: JDK_3 <jaydu1904@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Handle 2 axes at a time...
Date: Fri, 28 Aug 2009 12:03:59 -0700 (PDT)
Organization: http://groups.google.com
Lines: 49
Message-ID: <0bafa2ba-ed9b-4487-a6a2-a1aaa64b54da@d15g2000prc.googlegroups.com>
NNTP-Posting-Host: 116.73.128.98
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1251486239 26236 127.0.0.1 (28 Aug 2009 19:03:59 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 28 Aug 2009 19:03:59 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: d15g2000prc.googlegroups.com; posting-host=116.73.128.98; 
	posting-account=IVMuUAoAAAACFfM7ISsaO5gTXqbITJQ-
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) 
	Gecko/20090729 Firefox/3.5.2,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:566838


Hi guys,
I am trying to make a GUI in MATLAB that plots two graphs(say a sine
wave  and 2nd is its shifted version).
But I am unable to plot them differently on two different axes.

Here is the piece of code:

S.ax1 = axes('xlim',[0 1],'ylim',[0 1]);
%define axes1
set(S.ax1,'unit','pix','position',[50 325 570 250]);

S.ax2 = axes('xlim',[0 1],'ylim',[0 1]);
%define axes2
set(S.ax2,'unit','pix','position',[50 60 570 250]);


function [] = push_call(varargin)

S = varargin{3};
P = get(S.pop,'val');             %get value of popup menu 'pop'

switch P
    case 1
       axes(S.ax1);
                x = -5:0.01:5;
                y = sin(x);
                plot(x,y);

        switch findobj(get
(S.select_option,'selectedobject'))                    %get selected
radio button
            case S.advance
                axes(S.ax2);
                x = -5:0.01:5;
                y = sin(x+2);
                plot(x,y);
        end
end



I am getting an error

>Reference to non-existent field 'ax1'.
>Error in ==> plot_1>push_call at 67   axes(S.ax1);


please help me, or say where i am wrong.
thanks in advance