Organizing data into a matrix, Generating a matrix
2 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I need little help with data manipulation. I have a 250x3 cell that i have imported from excel file. Data looks like:
A B C
100 5 1.0325
100 10 1.5648
100 15 1.1456
200 5 1.8986
200 15 1.6545
300 10 1.9879
So I want to convert this data into a matrix with column A data as X axis and Column B data in Y axis. Something like as follows:
100 200 300 ... so on
5 1.0325 1.8986 0
10 1.5648 0 1.9879
15 1.1456 1.6545 0
.
.
.
so on
This is just an example and actually i have huge amount of data to deal with.
Any idea, help, tips or suggestions are appreciated.
Thanks in advance. //Arsalan
0 件のコメント
採用された回答
Andrei Bobrov
2011 年 10 月 31 日
A = [100 5 1.0325
100 10 1.5648
100 15 1.1456
200 5 1.8986
200 15 1.6545
300 10 1.9879]
[a1 j1 j1] = unique(A(:,1))
[a2 j2 j2] = unique(A(:,2))
out = [0,a1';a2 accumarray([j2 j1 ],A(:,3),[numel(a2),numel(a1)])]
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!