3d track plot in Matlab (ex-embedded) Function block
Mostrar comentarios más antiguos
Hi,
I connected x,y,z coordinates in my custom matlab function block and I used this code:
function out = fcn(x,y,z)
%#codegen
coder.extrinsic('plot3')
coder.extrinsic('grid')
coder.extrinsic('axis')
plot3(x,y,-z, 'or')
axis([0 1 -0.0001 0.0001 -1 0])
grid on
out = [x,y,z];
(with a Terminator block in the output port)
to plot a trajectory, but it plots a dot since it updates itself as one at a time. How can I draw a trajectory as track in the space (I want make it store previous coordinates) ?
Respuestas (1)
Azzi Abdelmalek
el 17 de Nov. de 2012
0 votos
Save your data to workspace, then plot what you want!
4 comentarios
Marco
el 17 de Nov. de 2012
Azzi Abdelmalek
el 17 de Nov. de 2012
Then In your embedded function add
hold on
Azzi Abdelmalek
el 17 de Nov. de 2012
Editada: Azzi Abdelmalek
el 17 de Nov. de 2012
I think Embedded function don't support hold on comand, use instead Matlab function block
Marco
el 17 de Nov. de 2012
Categorías
Más información sobre Simulink Functions 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!