How to arrange with the graph

2 ビュー (過去 30 日間)
Emilia
Emilia 2021 年 12 月 24 日
コメント済み: Emilia 2021 年 12 月 25 日
Hello :)
I need help creating a graph. I wrote in the theta code ranges to be zeros also in the y-axis, and other numbers to get just like this graph.
Thanks in advance
clc;
clear;
K_t=750;
K_r=250;
b=5;
f_z=0.1;
theta=0:360 ;
if theta==60:90 && theta==150:180 && theta==240:270
F_x=0;
F_y=0;
F=0;
else
h_cut=f_z*sin(theta*pi/180);
F_r=K_r*b*h_cut;
F_t=K_t*b*h_cut;
F_x=abs(-F_t.*cos(theta.*pi/180)-F_r.*sin(theta.*pi/180));
F_y=F_t.*sin(theta.*pi/180)-F_r.*cos(theta.*pi/180);
F=sqrt((F_x).^2+(F_y).^2);
plot(theta,F_x,'--r',theta,F_y,'--b',theta,F,'k' )
legend({'F_x' ,'F_y','F'})
end

採用された回答

VBBV
VBBV 2021 年 12 月 25 日
clc;
clear;
K_t=750;
K_r=250;
b=5;
f_z=0.1;
theta=0:360 ;
for i = 1: length(theta)
if (theta(i) >= 60 & theta(i) <= 90) || (theta(i) >= 150 & theta(i) <= 180) || (theta(i) >= 240 & theta(i) <= 270)
F_x(i)=0;
F_y(i)=0;
F(i)=0;
else
h_cut=f_z*sin(theta(i)*pi/180);
F_r=K_r*b*h_cut;
F_t=K_t*b*h_cut;
F_x(i)=abs(-F_t.*cos(theta(i).*pi/180)-F_r.*sin(theta(i).*pi/180));
F_y(i)=F_t.*sin(theta(i).*pi/180)-F_r.*cos(theta(i).*pi/180);
F(i)=sqrt((F_x(i)).^2+(F_y(i)).^2);
end
end
plot(theta,F_x,'--r',theta,F_y,'--b',theta,F,'k' )
legend('F_x' ,'F_y','F')
  1 件のコメント
Emilia
Emilia 2021 年 12 月 25 日
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by