|
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];
|