MATLAB Answers

ramesha
0

how to plot 2D graph in GUI?

Asked by ramesha
on 12 Apr 2014
Latest activity Commented on by ramesha
on 14 Apr 2014
i have two co-ordinates like x and y, I enter the values of x and y then how to plot in GUI? X Y 2 4 4 6 7 8 take the above values i plot the graph in GUI?

  0 Comments

Sign in to comment.

Tags

1 Answer

Answer by Alberto
on 12 Apr 2014
 Accepted Answer

function exgui
fh = figure( 'units','pixels',... 'position',[50 ,50 , 600, 500]);
X=[2 4 7] Y=[4 6 8] h=plot(X,Y,'--r','LineWidth',1) ;
end

  3 Comments

Run this program, it shows x and y are undefined function.
It worked in mine. I used capitals for variables X and Y.
function exgui
fh = figure( 'units','pixels', 'position',[50 ,50 , 600, 500]);
X=[2 4 7]
Y=[4 6 8]
h=plot(X,Y,'--r','LineWidth',1) ;
end
will show
Thank you.. .... I got result

Sign in to comment.