For Loop Variable Selection from Index

1 回表示 (過去 30 日間)
Sophia Collinson
Sophia Collinson 2020 年 11 月 2 日
編集済み: VBBV 2020 年 11 月 2 日
Hello,
As a part of a function, I need MATLAB to select a small section of data out of a large section of data, indexed by a variable called Counts. The image attached is a small section of the data available. The data file itself is a ~4000 x 12 table, so there are more variables I will need to eventually extract.
The code needs to take the values from the section thats indexed under 1 and then find the max BiSGSpeed value from the small sections, if that makes sense?
Currently, the code I have just finds the maximum BiSGSpeed from the whole table.
x = 0;
% x is used to identify which count I'm on
for Counts = x + 1
max(EngineStarts.BiSGSpeed)
%EngineStarts is the name of the main table
x = x + 1;
end
This is currently how far I've gotten with the code, I've had a few months off from coding and I'm unsure of where to go from here, so any help at all would be greatly appreciated.
This is using MATLAB 2019b

採用された回答

VBBV
VBBV 2020 年 11 月 2 日
編集済み: VBBV 2020 年 11 月 2 日
Assuming the vectors Time, BiSGspeed, Counts are equal length then you can try like
%if true
% code
% end
Time = [0.09 0.2 ...];
BiSGspeed = [...];
Counts = [...];
for counts = 1:length(Time)
...
end

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