Filter löschen
Filter löschen

Plot specific columns in cell array

4 Ansichten (letzte 30 Tage)
Chaman Srivastava
Chaman Srivastava am 23 Nov. 2020
Kommentiert: dpb am 23 Nov. 2020
Hello,
I'm new to MATLAB and still learning :) I've been struggling with one such command execution.
I have a cell array c28_20chs which has 5 cells inside it as shown in the picture. I need to navigate to the individual cells and then plot col 3,4 together as x anf y axis.
Is there any structured command for it? I would really appreciate if any one could guide me.

Akzeptierte Antwort

dpb
dpb am 23 Nov. 2020
for i=1:numel(c28_20chs)
hL(i)=plot(c28_20chs{i}(:,3),c28_20chs{i}(:,4));
if i==1, hold on; end
if isempty(c28_20chs(i)), continue, end
end
Read the background info on cell arrays for examples and explanation of dereferencing cell arrays.
  2 Kommentare
Chaman Srivastava
Chaman Srivastava am 23 Nov. 2020
Hello dpb.
Thanks for the code. Its indeed plotting the data, but i get an error-"Index in position 2 exceeds array bounds". What is this about?
Also can you please provide me a link to the -"background info on cell arrays for examples and explanation of dereferencing cell arrays" or suggest some keywords for me to find the correct info :)
Thanks!
dpb
dpb am 23 Nov. 2020
Paste the error in context -- not having your data can't duplicate here.
As for the information on cell arrays, start with
doc cell
It has examples; there's also the links under "Topics" at the bottom of the page, one of which is titled <Access Data in Cell Array>.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by