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 Center および File ExchangeAnimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by