4D trajectory in Matlab

2 次查看(过去 30 天)
Paulina
Paulina 2011-3-12
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?

采纳的回答

Walter Roberson
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.)
With very new Matlab there is the VideoWriter class.
You may be able to create AVI
  1 个评论
Paulina
Paulina 2011-3-13
I am using Matlab on my Mac version 7.11.0 (R2010b)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Animation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by