Create sperate matrices for all unique values in the 3rd column of a cell array
Show older comments
I have a cell array of 666x3, in this array the first and second columns have completely unique values, but the 3rd column has identifying values. I want to make a new array for each identifying value. Keep in mind there are many different values in column 3 as well and i dont want to manually input them, I want it to be done automatically so any data I use, the same result will be shown. Thank you!
Example:
initialArray =
column1 column2 column3
240.747574230792 298.790970549445 127
239.818737359994 297.862133678646 127
241.676411101591 297.862133678646 126
240.283155795393 296.933296807848 126
235.174553006003 296.004459937050 125
233.781297699806 295.540041501651 125
220.777581508630 269.997027554699 125
required:
array1=
column1 column2 column3
240.747574230792 298.790970549445 127
239.818737359994 297.862133678646 127
array2=
column1 column2 column3
241.676411101591 297.862133678646 126
240.283155795393 296.933296807848 126
array3=
column1 column2 column3
235.174553006003 296.004459937050 125
233.781297699806 295.540041501651 125
220.777581508630 269.997027554699 125
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing 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!