how to plot 2D graph in GUI?

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?

 Respuesta aceptada

Alberto
Alberto el 12 de Abr. de 2014

0 votos

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 comentarios

ramesha
ramesha el 14 de Abr. de 2014
Run this program, it shows x and y are undefined function.
Alberto
Alberto el 14 de Abr. de 2014
Editada: Alberto el 14 de Abr. de 2014
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
ramesha
ramesha el 14 de Abr. de 2014
Thank you.. .... I got result

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 12 de Abr. de 2014

Comentada:

el 14 de Abr. de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by