4D trajectory in Matlab
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2011-3-12
Please clarify which version of Matlab you are using, and which OS you are on. qtwrite() existed in Matlab 4, but by Matlab 5 was only available on the Mac (and only worked with colormaps of size 64.)
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!