plotting x vs y but not y vs x.
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nikhil
el 3 de En. de 2014
Comentada: Youssef Khmou
el 4 de En. de 2014
Hello all,
I have two vectors XN and YN. Their values are mentioned in the excel file attached. I want to plot YN vs XN. when I enter following code: plot(XN,YN) I didn't get any result. But when I enter plot(YN,XN), matlab shows me correct plot.
Can you please help me to resolve this issue, why MATLAB is plotting x vs y but not y vs x?
Thank you in advance
Nikhil
0 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 3 de En. de 2014
Maybe because your values are very small, try this
plot(x,y*1e+152)
3 comentarios
Youssef Khmou
el 4 de En. de 2014
it worked without amplifying factor, this issue is not clear yet ...
Más respuestas (1)
Youssef Khmou
el 3 de En. de 2014
Editada: Youssef Khmou
el 3 de En. de 2014
Nikhil,
with the file you posted, it plots correctly y=f(x) which has a peak in the abscissa x=4.
G=xlsread('file.xlsx');
x=G(:,1)
y=G(:,2)
plot(x,y)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!