How can I split data into categories based on one element in a cell?

1 回表示 (過去 30 日間)
Janna Hinchliff
Janna Hinchliff 2019 年 2 月 25 日
コメント済み: dpb 2019 年 2 月 25 日
I have data stored in a cell in the form
dataovenparamcell = {oventemp,ovencurrent,timeto50,data};
where there are 6 1x4 cell arrays within dataovenparamcell where oventemp, ovencurrent and timeto50 are single numbers and data is an mxn matrix array. I want to group my data using the ovencurrent variable, such that each of the 6 1x4 arrays are grouped into cells with the same ovencurrent. For example, in one case, I have a data set where the six values of ovencurrent are 9, 11, 13, 9, 11, 13. I want to make this into 3 cell arrays - one for 9, one for 11 and one for 13. This would look something like
dataovenparamcell1 = {{oventemp, 9, timeto50, data} {oventemp, 9, timeto50, data}}
dataovenparamcell2 = {{oventemp, 11, timeto50, data} {oventemp, 11, timeto50, data}}
dataovenparamcell3 = {{oventemp, 13, timeto50, data} {oventemp, 13, timeto50, data}}
How could I go about doing this?
  1 件のコメント
dpb
dpb 2019 年 2 月 25 日
Make it easy for somebody to give you code...attach a dataset.
It's much easier to just write code to a specific problem when don't have to try to create the dataset first...I'm generally too lazy to do the latter but may often do the former... :)

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by