フィルターのクリア

undefine function or variable

2 ビュー (過去 30 日間)
marwa marwan
marwa marwan 2015 年 6 月 24 日
編集済み: Walter Roberson 2015 年 6 月 25 日
ihave a vector positionsa with 20 elements and a variable Alpha_posa and a want to take th ith elemet but this error will kill me
??? Undefined function or method 'Positionsa'
for input arguments of type 'double'.
Error in ==> Untitled at 69
Alpha_posa=Positionsa(i);

採用された回答

Brendan Hamm
Brendan Hamm 2015 年 6 月 24 日
Judging by what you have written and the error given it seems that your issue is with the capitalization. MATLAB is case sensitive and therefore you would want:
Alpha_posa = positionsa(i);
  2 件のコメント
Brendan Hamm
Brendan Hamm 2015 年 6 月 25 日
I would like to reiterate you original statement. You say that you have a 20-by-1 vector positionsa.
Your error states:
??? Undefined function or method ' Positionsa ' for input arguments of type 'double'.
Error in ==> Untitled at 69 Alpha_posa=Positionsa(i);
Given this error, it is clear the command you typed is:
Alpha_posa=Positionsa(i); % Error!
MATLAB is case sensitive, so you need to type:
Alpha_posa = positionsa(i); % This should work if I is also defined
So the following set of commands will work:
positionsa = rand(20,1); % Random vector with 20 elements
i = 5; % An variable for indexing
Alpha_posa = positionsa(i) % Extract the 5th element.
marwa marwan
marwa marwan 2015 年 6 月 25 日
you are so right...samll error can confuse alot thank you for your time

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

その他の回答 (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