“plot” function for some repetitive X values
Mostrar comentarios más antiguos
Hi, I would like to use “plot” function for some repetitive X values e.g: 1:10 and again 10:1 but the Y values are differ(in one curve).
I want to show effect of increasing value [1:10] and the decreasing value [10:1] in one figure.*
Could you please let me know what the solution is?
Thanks,
1 comentario
Deepak Sharma
el 25 de Mayo de 2021
Editada: Deepak Sharma
el 25 de Mayo de 2021
I need help in below plot, my xaxis values = [0 10 20 30 40 50 60 70 80 90 80 70 60 50 40 30 20 10 0]. i want to unfold this graph so that my xaxis must follow the original trend ie 0-->90-->0.

Respuesta aceptada
Más respuestas (2)
Fangjun Jiang
el 28 de Ag. de 2011
What effect do you want? You can always split them and plot them separately.
x=1:10;
y1=2*x+10;
y2=x.^2;
x=[x x];y=[y1 y2];
plot(x,y)
If you don't like the line from x=10 to x=1, replace the last line with,
plot(x,y,'r*');
To split:
idx1=1:10;
idx2=11:20;
figure;
plot(x(idx1),y(idx1),'r',x(idx2),y(idx2),'b');
1 comentario
KU
el 29 de Ag. de 2011
Walter Roberson
el 29 de Ag. de 2011
x = 1:10;
plot(x, y1, x, y2)
1 comentario
KU
el 29 de Ag. de 2011
Categorías
Más información sobre Graphics Object Properties en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!