Manipulating Cell arrays element

6 Ansichten (letzte 30 Tage)
Amit Chakraborty
Amit Chakraborty am 4 Jun. 2022
Say I have a cell array called aa. Inside the cell I have 5 data elements [in reality it is huge matrix]. That 5 data element is for green and red light.
green light =1;
red light = 2;
aa index is same as ss. Means the first data element in aa is for green light, the second data element is for red light and so on.
I want to make the aa cell in such a way that it contains only for green light data element.
Can any one help me ?
Thanks in ADVANCE!!!!
aa = {rand(280,3) , rand(280,3),rand(280,3),rand(280,3),rand(280,3)};
ss = [1 2 1 2 1]; % Matrix for Green and Red light
  4 Kommentare
Jan
Jan am 4 Jun. 2022
@Amit Chakraborty: Are you aware, that "Null" is no standard syntax in Matlab? Should the readers understand this e.g. as [] ?
Amit Chakraborty
Amit Chakraborty am 4 Jun. 2022
@Jan, Yes you are correct. I want to mean that reader should take
Null = [ ]

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Matt J
Matt J am 4 Jun. 2022
Bearbeitet: Matt J am 4 Jun. 2022
aa(ss==2)={[]};

Weitere Antworten (0)

Kategorien

Mehr zu Cell Arrays finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by