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

Matt J
Matt J 2022년 6월 4일
We need a shrunken-down example, showing the input and desired output.
Amit Chakraborty
Amit Chakraborty 2022년 6월 4일
desired output:
aa = {rand(280,3) Null rand(280,3) Null rand(280,3)}
Null = Red light data that I want to ignored.
so, aa contains only green light data
Jan
Jan 2022년 6월 4일
@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 2022년 6월 4일
@Jan, Yes you are correct. I want to mean that reader should take
Null = [ ]

댓글을 달려면 로그인하십시오.

 채택된 답변

Matt J
Matt J 2022년 6월 4일
편집: Matt J 2022년 6월 4일

1 개 추천

aa(ss==2)={[]};

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

태그

질문:

2022년 6월 4일

댓글:

2022년 6월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by