How to extract multiple matches into separate rows?

1 回表示 (過去 30 日間)
Nadeera Gunartna
Nadeera Gunartna 2017 年 7 月 19 日
コメント済み: Nadeera Gunartna 2017 年 7 月 19 日
I have a CSV file (see attached), from the file i want to extract values in the column M (Cab/100kg=f) related to each group (x, y, z) and then plot the plot the frequency of column f against the value in f, related to each group and predict lognormal distribution. and then need to calculate variance. I appreciate if anybody can help with this.
Thanks in advance.
  1 件のコメント
KSSV
KSSV 2017 年 7 月 19 日
What have you tried?

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

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2017 年 7 月 19 日
編集済み: Andrei Bobrov 2017 年 7 月 19 日
T = readtable('test sheet.csv');
T_variance = varfun(@var,T(:,[1,end]),'G','Groups');
for plotted
For_plot = accumarray(findgroups(T.Groups),T{:,'Cab_100kg'},[],@(x){x});
y = [cellfun(@(x)(1:numel(x))',For_plot,'un',0),For_plot]';
plot(y{:});
  1 件のコメント
Nadeera Gunartna
Nadeera Gunartna 2017 年 7 月 19 日
Many Thanks. first two lines gives the answer for variance. But before get the answer I have to check the data fit with lognormal distribution, if it only fits, then have to calculate. Thanks again.

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

Community Treasure Hunt

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

Start Hunting!

Translated by