フィルターのクリア

Plotting in 3d

1 回表示 (過去 30 日間)
Philosophaie
Philosophaie 2017 年 10 月 9 日
回答済み: KSSV 2017 年 10 月 10 日
I cannot put all of the plot into one window. How do I plot in 3D?
v=3E8;
f=760E12;
x=zeros(400);
y=zeros(400);
z=zeros(400);
xx=zeros(400);
yy=zeros(400);
for tstep=1:360
t=tstep*1e-4;
x(tstep)=v*t;
y(tstep)=v/f*cos(tstep*pi/180);
z(tstep)=v/f*sin(tstep*pi/180);
xx(tstep)=(x(t)-y(t)*cos(45*pi/180));
yy(tstep)=z(t)-y(t)*sin(45*pi/180);
hold on;
plot(xx(tstep),yy(tstep),'-b');
end;
hold off;

回答 (1 件)

KSSV
KSSV 2017 年 10 月 10 日
v=3E8;
f=760E12;
x=zeros(400);
y=zeros(400);
z=zeros(400);
xx=zeros(400);
yy=zeros(400);
for tstep=1:360
t=tstep*1e-4;
x=v*t;
y=v/f*cos(tstep*pi/180);
z=v/f*sin(tstep*pi/180);
xx(tstep)=(x-y*cos(45*pi/180));
yy(tstep)=z-y*sin(45*pi/180);
hold on;
plot(xx(tstep),yy(tstep),'.b');
end
hold off;
Can be achieved without loop also.

カテゴリ

Help Center および File ExchangeArgument Definitions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by