degree = 140:0.001:220;
thetad = 4;
f = atan(degree*(pi/180));
s = 90-f;
r = 0.1*(degree*(pi/180));
rd = diff(r);
Ar = -r*thetad^2;
Atheta = 2*rd*thetad;
Nc = (0.5*Ar)/cos(s);
Fc = (0.5*Atheta)+Nc*sin(s);
plot(degree,Ar,'black')
plot(degree,Atheta,'blue')
plot(degree,Nc,'yellow')
plot(degree,Fc,'green')
hold on;
grid on;

回答 (3 件)

Image Analyst
Image Analyst 2018 年 11 月 19 日

0 投票

Since diff(s) gives one less element than s, your array dimensions don't match when you try to add Atheta and sin(s).
Star Strider
Star Strider 2018 年 11 月 19 日

0 投票

The hold on call should be just after the first plot call, and diff produces a vector (here) that is one element shorter than its argument.
Try this:
degree = 140:0.001:220;
thetad = 4;
f = atan(degree*(pi/180));
s = 90-f;
r = 0.1*(degree*(pi/180));
rd = gradient(r);
Ar = -r*thetad^2;
Atheta = 2*rd*thetad;
Nc = (0.5*Ar)/cos(s);
Fc = (0.5*Atheta)+Nc*sin(s);
plot(degree,Ar,'black')
hold on
plot(degree,Atheta,'blue')
plot(degree,Nc,'yellow')
plot(degree,Fc,'green')
hold off
grid on
madhan ravi
madhan ravi 2018 年 11 月 19 日

0 投票

In addition to sir Image Analyst's explanation :
degree = 140:0.001:220;
thetad = 4;
f = atan(degree*(pi/180));
s = 90-f;
r = 0.1*(degree*(pi/180));
rd = diff(r);
Ar = -r*thetad^2;
Atheta = 2*rd*thetad;
Nc = (0.5*Ar)./cos(s);
Fc = (0.5.*Atheta)+Nc(1:numel(Atheta)).*sin(s(1:numel(Atheta)));
plot(degree(1:numel(Atheta)),Ar(1:numel(Atheta)),'black')
hold on;
plot(degree(1:numel(Atheta)),Atheta(1:numel(Atheta)),'blue')
plot(degree(1:numel(Atheta)),Nc(1:numel(Atheta)),'yellow')
plot(degree(1:numel(Atheta)),Fc(1:numel(Atheta)),'green')
grid on;

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

製品

リリース

R2018b

質問済み:

2018 年 11 月 19 日

回答済み:

2018 年 11 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by