MATLAB Answers

Select specific cells from a cell array and create a seperate vector

3 views (last 30 days)
Ilias Minas
Ilias Minas on 28 Mar 2020
Commented: the cyclist on 28 Mar 2020
Hi everyone,
I have the following cell array
Max_Col_Cell(9,10,15)
I want to isolate every combination of the first two elements (9,10) for all the 15 values of the third element and create new vectors having one column with 15 rows.
For example create a vector having (1,1,:). Another vector having (2,1,:) etc....
I am trying to write a for loop but its not working.
How can i do this?
Ilias

  2 Comments

Ilias Minas
Ilias Minas on 28 Mar 2020
Thank for your reply.
I thought that having seperate vactors it would be easier to handle them cause i want to extract the maximum value of those 15 elements.
Is it possible to rearrange in the way that i want in a matrix?

Sign in to comment.

Accepted Answer

the cyclist
the cyclist on 28 Mar 2020
Edited: the cyclist on 28 Mar 2020
Does your cell array have only numeric values in it?
If yes, then
maxVal = max(cell2num(C),[],3)
where C is your cell array.

  3 Comments

Ilias Minas
Ilias Minas on 28 Mar 2020
I ve tried this and it gives me the following error
Undefined function or variable 'cell2num'.

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by