Plotting of a cell array

2 visualizzazioni (ultimi 30 giorni)
Amit Chakraborty
Amit Chakraborty il 3 Giu 2022
Risposto: Chunru il 3 Giu 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 !!!!!

Risposte (1)

Chunru
Chunru il 3 Giu 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));

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by