フィルターのクリア

Index exceeds the number of array elements (1). Error in HW08_Spaceship (line 34) xT =(5*(cos(4​5)+B(T+Kon​e)*sin(T)/​2+sin(45)+​B*(T+1/Kon​e)*cos(T))​) >>

1 回表示 (過去 30 日間)
James Keiser
James Keiser 2019 年 1 月 30 日
編集済み: madhan ravi 2019 年 1 月 30 日
R= 40;
Xo= 125;
B = 42;
Kone = 5;
T = 0: 30;
xT =(5*(cos(45)+B(T+Kone)*sin(T)/2+sin(45)+B*(T+1/Kone)*cos(T)))
yT =(5*(sin(45)+B(T+Kone)*sin(T)/2-cos(45)+B*(T+1/Kone)*cos(T)))
plot (xT,yT,'r--')

回答 (1 件)

madhan ravi
madhan ravi 2019 年 1 月 30 日
編集済み: madhan ravi 2019 年 1 月 30 日
Suspect it should be sind() and cosd() ?:
R= 40;
Xo= 125;
B = 42;
Kone = 5;
T = 0:30;
% v-----------------------------v-----missed it
xT =(5*(cos(45)+B*(T+Kone).*sin(T)/2+sin(45)+B*(T+1/Kone).*cos(T)))
% ^---- was the reason for your error
% v-----------------------------v-----missed it
yT =(5*(sin(45)+B*(T+Kone).*sin(T)/2-cos(45)+B*(T+1/Kone).*cos(T)))
% ^---- was the reason for your error
plot (xT,yT,'r--')

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by