フィルターのクリア

Looping for set Indices only

6 ビュー (過去 30 日間)
Ferd
Ferd 2012 年 6 月 11 日
Hi,
I have an arrays that is slightly off the my predicted values after calculations and would like to investigate those iterations. The two arrays are basically indices from the loop. I identified those itearations as an array. Now, I would like to use just those indices in another loop to calculate further.
LowRPMIndex = [16;31;46;60;75;90;105;119;130;144;145;146];
for y= 1:length(LowRPMIndex)
PositiveO2(y)= find(O2(:,LowRPMIndex)>0);
end
I would like the "y" to be the Index value value while it loops until the length of the LowRPMIndex.
Thanks
  2 件のコメント
Ryan
Ryan 2012 年 6 月 11 日
So you are trying to populate a vector Positive02 that is strictly the positive values of all rows and the LowRPMIndex columns of O2?
Ferd
Ferd 2012 年 6 月 11 日
Yes, indeed!

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

採用された回答

bym
bym 2012 年 6 月 11 日
O2 = randi([-5,10],150); %Create sample data
subO2 =O2(:,LowRPMIndex); % pull out all rows of LowRPMIndex columns
PositiveO2 = subO2(subO2>0); % get positive values
  1 件のコメント
Ferd
Ferd 2012 年 6 月 12 日
or without the loop...:) kewl thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by