have to use plot3
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Veera Kanmani
el 14 de Mzo. de 2018
Editada: Walter Roberson
el 15 de Mzo. de 2018
i have 3 coordinates x,y,z.. i have to plot it using plot3. my x,y,z coordinates gets updated in a for loop. i want all the points to get plotted in one plot using the default line style 'Solid line'. but ican't get it.i can only able to get using other line styles like 'o' , '.'.. Can anyone please help me with it???
0 comentarios
Respuesta aceptada
Walter Roberson
el 14 de Mzo. de 2018
You cannot plot with solid line style if you only plot one point at a time.
You should save your data in vectors and plot3() the entire vector after the loop.
If you need the line to update during the run for animation purposes, then have a look at animatedline()
6 comentarios
Veera Kanmani
el 15 de Mzo. de 2018
Editada: Walter Roberson
el 15 de Mzo. de 2018
Walter Roberson
el 15 de Mzo. de 2018
Editada: Walter Roberson
el 15 de Mzo. de 2018
x = 0; y = 0; z = 0;
h = animatedline(x, y, z);
view(3)
for K = 1 : 100
x = x + randi([-1 1]);
y = y + randi([-1 2]);
z = z + randi([-2 1]);
addpoints(h, x, y, z);
drawnow();
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Animation 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!