Thread Subject: plotting ploblem

Subject: plotting ploblem

From: Deock-Hee

Date: 22 Nov, 2009 11:59:04

Message: 1 of 3

i am trying to make a excel add-in which draws 3 vector graph.

specifically, i am trying to plot the second and lthird series against the first.

so, x vs y1, y2

i works find when i try in the matlab environment;

plot(x,y1); hold all;plot(x,y2); hold all;hold off;figure(gcf);

after i run this in the command window, figure1 shows exactly what i expected.

so, i generated m-file but surprisingly it shows different m-file just like follows;

function createfigure(X1, YMatrix1)
%CREATEFIGURE(X1,YMATRIX1)
% X1: vector of x data
% YMATRIX1: matrix of y data

% Auto-generated by MATLAB on 22-Nov-2009 20:56:11

% Create figure
figure1 = figure;

% Create axes
axes1 = axes('Parent',figure1);
box(axes1,'on');
hold(axes1,'all');

% Create multiple lines using matrix input to plot
plot(X1,YMatrix1);



I can't draw y2 according to above source, right?

what should i do to make creafigure(x, y1, y2) function?

thanks in advance and forgive my poor English.

Subject: plotting ploblem

From: Deock-Hee

Date: 22 Nov, 2009 12:11:04

Message: 2 of 3

"Deock-Hee " <dhcho@icu.ac.kr> wrote in message <heb928$1fh$1@fred.mathworks.com>...
> i am trying to make a excel add-in which draws 3 vector graph.
>
> specifically, i am trying to plot the second and lthird series against the first.
>
> so, x vs y1, y2
>
> i works find when i try in the matlab environment;
>
> plot(x,y1); hold all;plot(x,y2); hold all;hold off;figure(gcf);
>
> after i run this in the command window, figure1 shows exactly what i expected.
>
> so, i generated m-file but surprisingly it shows different m-file just like follows;
>
> function createfigure(X1, YMatrix1)
> %CREATEFIGURE(X1,YMATRIX1)
> % X1: vector of x data
> % YMATRIX1: matrix of y data
>
> % Auto-generated by MATLAB on 22-Nov-2009 20:56:11
>
> % Create figure
> figure1 = figure;
>
> % Create axes
> axes1 = axes('Parent',figure1);
> box(axes1,'on');
> hold(axes1,'all');
>
> % Create multiple lines using matrix input to plot
> plot(X1,YMatrix1);
>
>
>
> I can't draw y2 according to above source, right?
>
> what should i do to make creafigure(x, y1, y2) function?
>
> thanks in advance and forgive my poor English.




Y was matrix not a vector........-_-;

I thought that function needs 3 inputs....-_-;

it works finid so far.....but another ploblem occurred!!!

i made excel-addin using above matlab generated m-file

and i found that whenever data changes the function trys to make another figure...

iI would like to make figure once and data change should be applied in the original figure instead of making another poped up figure2!!!

what should i do?

Tanks in advance. ^^*

Subject: plotting ploblem

From: TideMan

Date: 22 Nov, 2009 23:46:51

Message: 3 of 3

On Nov 23, 1:11 am, "Deock-Hee " <dh...@icu.ac.kr> wrote:
> "Deock-Hee " <dh...@icu.ac.kr> wrote in message <heb928$1f...@fred.mathworks.com>...
> > i am trying to make a excel add-in which draws 3 vector graph.
>
> > specifically, i am trying to plot the second and lthird series against the first.
>
> > so, x vs y1, y2
>
> > i works find when i try in the matlab environment;
>
> > plot(x,y1); hold all;plot(x,y2); hold all;hold off;figure(gcf);
>
> > after i run this in the command window, figure1 shows exactly what i expected.
>
> > so, i generated m-file but surprisingly it shows different m-file just like follows;
>
> > function createfigure(X1, YMatrix1)
> > %CREATEFIGURE(X1,YMATRIX1)
> > %  X1:  vector of x data
> > %  YMATRIX1:  matrix of y data
>
> > %  Auto-generated by MATLAB on 22-Nov-2009 20:56:11
>
> > % Create figure
> > figure1 = figure;
>
> > % Create axes
> > axes1 = axes('Parent',figure1);
> > box(axes1,'on');
> > hold(axes1,'all');
>
> > % Create multiple lines using matrix input to plot
> > plot(X1,YMatrix1);
>
> > I can't draw y2 according to above source, right?
>
> > what should i do to make creafigure(x, y1, y2) function?
>
> > thanks in advance and forgive my poor English.
>
> Y was matrix not a vector........-_-;
>
> I thought that function needs 3 inputs....-_-;
>
> it works finid so far.....but another ploblem occurred!!!
>
> i made excel-addin using above matlab generated m-file
>
> and i found that whenever data changes the function trys to make another figure...
>
> iI would like to make figure once and data change should be applied in the original figure instead of making another poped up figure2!!!
>
> what should i do?
>
> Tanks in advance. ^^*

To avoid making another figure, remove this line:
figure1 = figure;
and replace it with:
clf
which clears the present figure.

You can make the input matrix YMatrix1 like this:
YMatrix1=[y1 y2];

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com