Filter löschen
Filter löschen

Plotting of a cell array

1 Ansicht (letzte 30 Tage)
Amit Chakraborty
Amit Chakraborty am 3 Jun. 2022
Beantwortet: Chunru am 3 Jun. 2022
For example, I have a data of 4 persons (Say ; a,b,c,d ) which are confined in a cell a array called M. Now I want to plot first 3 persons data in ONE single plot.
I have written the code just want to be confirmed , that my method is correct. So, I writing the code below.
a = rand(12,10);
b = rand( 5, 12);
c = rand( 4, 9);
d = rand( 10, 15);
M = {a,b,c,d}; % Cell Array
p = 3; % for how many persons I want to plot my data
figure;
hold on;
cellfun(@plot,M(:,1:p));
I do not have any syntay error in my code. Just want to check my logic is correct or not !!!
Thank you in ADVANCE !!!!!

Antworten (1)

Chunru
Chunru am 3 Jun. 2022
a = rand(12,10)+4;
b = rand( 5, 12)+3;
c = rand( 4, 9)+2;
d = rand( 10, 15)+1;
M = {a,b,c,d}; % Cell Array
p = 3; % for how many persons I want to plot my data
figure;
hold on;
cellfun(@plot,M(1:p));

Kategorien

Mehr zu Line Plots 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