4D trajectory in Matlab
显示 更早的评论
Hej, I am very new to Matlab and have no programming experience
I would like to obtain 3D trajectory of nuclear motion playing in time. For now I entered a code:
function [] = plotFunc(nc) %UNTITLED4 Summary of this function goes here % Detailed explanation goes here x=nc(1,:); y=nc(2,:); z=nc(3,:);
for i=1:length(x) plot3(x(i),y(i),z(i), '-rs', 'LineWidth',3)
pause(0.2)
hold on
plot3(x,y,z, '-m', 'LineWidth',0.5)
grid on
xlabel('x')
ylabel('y')
zlabel('z')
axis([80 95 30 50 0 20])
M(:,i) = getframe
end
movie(M) save M
It gives me a line and points appear over it in time (it would be better if it drew the trajectory from scratch but it's not my main concern. if u can offer help on that it would also be greatly appreciated though). Now I want to save this animation in some useful format. I used qtwrite command (qtwrite(M)) but it returns an error: ??? Undefined function or method 'qtwrite' for input arguments of type 'struct'.
Do u have any suggestions of how to get this animation?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Animation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!