フィルターのクリア

index must be a positive integer or logical

1 回表示 (過去 30 日間)
Benjamin
Benjamin 2012 年 8 月 8 日
Here is the portion of code that I am using currently that is giving me this error:
A = interpolate;
averg = mean([A(1:end-2),A(3:end)],2);
real_num = A(2:end-1);
streaking = [];
for idx = real_num
streaking(:,idx) = (abs(A(:,idx)-averg(idx))./averg(idx))*100;
end
>> Attempted to access A(:,73.2855); index must be a positive integer or logical.
>> Error in rad_cal2 (line 818)
streaking(:,idx) = (abs(A(:,idx)-averg(idx))./averg(idx))*100;
interpolate is a matrix

採用された回答

Matt Fig
Matt Fig 2012 年 8 月 8 日
編集済み: Matt Fig 2012 年 8 月 8 日
The solution will depend on what you want to do. You could simply do:
for idx = round(real_num)
streaking(:,idx) = (abs(A(:,idx)-averg(idx))./averg(idx))*100;
end

その他の回答 (0 件)

カテゴリ

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