Determine averages for duplicate values

3 ビュー (過去 30 日間)
BOB
BOB 2017 年 12 月 13 日
回答済み: KL 2017 年 12 月 13 日
Hi,
I have a cell array (11708 x 1) called "merged" where each value is the station name and the channel. I also have the residual for each entry in this cell array also as a cell array (11708 x 1). I want to determine the average residual for each station i.e. find duplicate entries and average associated values.
Example "merged" cell array entry: SUE HHE (i.e. its text) Example "res" cell array entry: 1.4224
If anyone could provide some help for this it would be much appreciated.
Cheers

採用された回答

KL
KL 2017 年 12 月 13 日
use a table and then varfun with grouping variable as your station name,
T = cell2table(C,'v',{'stationName','channelName',residual'});
T1 = varfun(@mean,T,'GroupingVariables','stationName');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by