Selectively plotting cell array data
Show older comments
Hi,
I have organised all of my data (stripped from image file names and info) in a cell array (as shown below).

My goal is to generate 1 figure per sample code, each containing a plot for each element distribution available for that sample. (A similar layout to the picture below).

As such, I am looking for a way to selectively plot on the one figure, only data points that are 'tagged' by the same sample code, and start a new figure once it's done with the curent sample.
I have seen something similar done with accumarray, to split up the one larger cell, as such:
>> a = [1,1;1,2.5;1,3;2,2;2,2;2,2;3,10;3,11;3,14;3,19;4,9];
>> C = accumarray(a(:,1),(1:size(a,1))',[],@(r){a(r,:)});
>> C{:}
ans =
1 1
1 2.5
1 3
ans =
2 2
2 2
2 2
ans =
3 10
3 11
3 14
3 19
ans =
4 9
but I am not familiar with accumarray and its syntax, so I am struggling to integrate it within my code.
Accepted Answer
More Answers (0)
Categories
Find more on Data Type Identification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!