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 CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by