Hi guys, I have a cell array with 90 cells. Each cell consists of 6 columns and approximately one million rows. Column 1 shows date. Column 2 shows time. Column 3 shows max value. Column 4 shows min value. Column 5 shows closing value. I want to do the following: i want to calculate the average value of max and min of every row in column 3 and 4. For instance, if the max value is 6 and the min value is 2 then the average of the two is 4.

 採用された回答

Geoff Hayes
Geoff Hayes 2014 年 10 月 18 日

0 投票

It sounds like you just want to add a seventh column to each cell in your cell array. Just sum the third and fourth columns and divide by two
% iterate over each cell
for k=1:length(myCells)
myCells{k} = [myCells{k} (0.5*(myCells{k}(:,3)+myCells{k}(:,4)))];
end
The above assumes that myCells is your cell array with 90 cells.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Cell Arrays についてさらに検索

質問済み:

AA
2014 年 10 月 18 日

回答済み:

2014 年 10 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by