i need code for small project

1 回表示 (過去 30 日間)
Marwan Tayfour
Marwan Tayfour 2021 年 10 月 11 日
回答済み: Image Analyst 2021 年 10 月 11 日
if x= sin t
x=sin 2t
t=0 :pi/2:pi:3*pi/2:2*pi:5*pi/2:3*pi7*pi/2:4*pi
i need the diagram

回答 (2 件)

Image Analyst
Image Analyst 2021 年 10 月 11 日
I don't even know what that means. Please use more words to explain, and maybe attach a diagram that you think it should look like.
You have to define both t and x before you do "if x=sin t" and the proper way would be
if x == sin(t)
but even that is not good since they're floating point numbers so you should read the FAQ:
But anyway not sure what Diagram means, but did you try plot:
plot(t, x, 'b-.', 'LineWidth', 2, 'MarkerSize', 20);

KSSV
KSSV 2021 年 10 月 11 日
t=0 :pi/2:pi:3*pi/2:2*pi:5*pi/2:3*pi/7*pi/2:4*pi ;
x1 = sin(t) ;
x2 = sin(2*t) ;
plot(t,x1,'r',t,x2,'b')
legend('sin(t)','sin(2t)')

カテゴリ

Help Center および File ExchangeSurfaces, Volumes, and Polygons についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by