动画剧情/轨迹在MATLAB /八度 [英] animate plot / trajectory in matlab / octave

查看:949
本文介绍了动画剧情/轨迹在MATLAB /八度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用MATLAB /八度,我希望它盘旋了动画这种螺旋形或倒

I'm trying to animate this spiral using matlab / octave I want it to spiral up or down

t = 0:0.1:10*pi;
r = linspace (0, 1, numel (t));
z = linspace (0, 1, numel (t));
plot3 (r.*sin(t), r.*cos(t), z);

我试图用一个for循环动画,但只是给了我一个锥体形状见下图

I tried using a for loop to animate it but that just gives me a cone shape see code and image below

clear all, clc,clf,tic
t = 0:0.1:10*pi;
r = linspace (0, 1, numel (t));
z = linspace (0, 1, numel (t));

for ii=1:length(r)
    ii
    plot3 (r.*sin(t(ii)), r.*cos(t(ii)), z);
    hold on
    %pause (.00001)
end

图片

Image

推荐答案

下面出现在八度3.6.2工作

The following appears to work in Octave 3.6.2

t = 0:0.1:10*pi;
r = linspace (0, 1, numel (t));
z = linspace (0, 1, numel (t));

figure
axis([-1 1 -1 1 0 1])
hold on

for ii=1:length(r)
    plot3 (r(ii)*sin(t(ii)), r(ii)*cos(t(ii)), z(ii),'*');
    pause (.001)
end

这篇关于动画剧情/轨迹在MATLAB /八度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆