Logical Indexing of Cell Array containing matrices
이전 댓글 표시
Hi everyone,
I need help with indexing cell arrays. I have a cell array, which contains matrices in the first, a string in the second and three identifiers in the third-fifth columns (see attached screenshot)

. What I want to do is a plot of specific values, which are located in the matrix of the first column and want to access those values with logical indexing of the identifiers. As a matter of fact, my logical indexing fails, it is not as straight forward as for standard arrays.
See my code below:
plot(R1{(R1{:,3} == phi && R1{:,4} == layer && R1{:,5} == speed),1}(:,6), ...
R1{(R1{:,3} == phi && R1{:,4} == layer && R1{:,5} == speed),1}(:,3),'Color',color(1,:),'LineStyle','-','LineWidth',1)
I have already tried the solutions with strcmp, but this doesn't work either...
Thanks for your help in advance! Georg
댓글 수: 3
Adam
2016년 11월 7일
What is the error message of the failure. I can't read that screenshot very well though the error shown there presumably isn't the problem with your logical indexing since it is just an undefined function.
Georg Söllinger
2016년 11월 7일
KSSV
2016년 11월 7일
Can you attach R1 data and say what is phi and layer?
채택된 답변
추가 답변 (1개)
KSSV
2016년 11월 7일
0 개 추천
abs is not defined for cell. Convert it to a array/ matrix and then use abs.
카테고리
도움말 센터 및 File Exchange에서 Numeric Types에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!