Plotting of a cell array

3 ビュー (過去 30 日間)
Amit Chakraborty
Amit Chakraborty 2022 年 6 月 3 日
回答済み: Chunru 2022 年 6 月 3 日
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 !!!!!

回答 (1 件)

Chunru
Chunru 2022 年 6 月 3 日
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));

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by