フィルターのクリア

Why do I get an error'Undefined function or variable 'i'' do we need to define i.

1 回表示 (過去 30 日間)
...
if(from<to)
for i=from:1:to
if(i==2)
%translating and shifting basis:
tempvector=shiftbasis(1,2,yaw,tilt,wing,cone)*(tempvector-tower);
end
if(i==3)
%translating and shifting basis:
tempvector=shiftbasis(2,3,yaw,tilt,wing,cone)*(tempvector-nacelle);
end
if (i==4)
%shifting basis:
tempvector=shiftbasis(3,4,yaw,tilt,wing,cone)*tempvector;
end
end
else
%If the transformation is from a high index to a lower:
if(from>to)
fori=from-1:-1:to
if(i==1)
%shifting basis and translating:
tempvector=(shiftbasis(2,1,yaw,tilt,wing,cone)*tempvector)+tower;
end
...
  1 件のコメント
KSSV
KSSV 2017 年 9 月 28 日
Where is the error line? Where are the other variables?

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

採用された回答

Walter Roberson
Walter Roberson 2017 年 9 月 28 日
You need a space between the for and the i in your fori= line
  1 件のコメント
Bishow Shrestha
Bishow Shrestha 2017 年 9 月 29 日
Thanks.. Thats a silly mistake n really didn't notice that.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by