how do I plot specific columns from a cell array?

조회 수: 7 (최근 30일)
cemile basgul
cemile basgul 2020년 6월 4일
답변: madhan ravi 2020년 6월 4일
Hi,
I have a cell array of 49 columns and each stores temperature values and has different row numbers. That is IntTemperatures. I want to plot specific rows from that cell array, let say 1, 11, 21, 31 and 41.
for k=1:layers-1
IntTemperatures{k}=Tnodes(timepoints*k+1:end,(k*2)+1); %Temperatures of interlayers
end
If it was a matrix than this could work, so I am trying to do something like this
layerpicks=[1,11,21,31,41];
plot(time./60,IntTemperatures(:,layerpicks),'.')
I have tried this by looking at the other comments
figure;
hold on;
cellfun(@plot,IntTemperatures);
However, this prints everything and I do not have the control of the x axis.
Thank you!
  댓글 수: 1
Fangjun Jiang
Fangjun Jiang 2020년 6월 4일
  1. Need to clarify row/column in your question
  2. You can use random number to make your example
  3. Why not use a for-loop

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

답변 (1개)

madhan ravi
madhan ravi 2020년 6월 4일
layerpicks=[1,11,21,31,41];
plot(time/60,cell2mat(IntTemperatures(:,layerpicks)),'.')

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by