Different line style and color in cell

8 Ansichten (letzte 30 Tage)
olodyusuf
olodyusuf am 19 Mai 2020
Beantwortet: Mehmed Saad am 19 Mai 2020
I have a 1 × 4 cell, with each cell containing an array of 1 × 15. I want to plot the cell using different line style and color.

Antworten (1)

Mehmed Saad
Mehmed Saad am 19 Mai 2020
you can use for loop or you can use cellfun.
data= {rand(1,15) rand(1,15) rand(1,15) rand(1,15)};
line_style = {'-','--',':','-.'};
line_color = {'r','g','b','k'};
figure,hold on
cellfun(@(x,y,z) plot(x,'LineStyle',y,'LineWidth',2,'Color',z),data,line_style,line_color)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Produkte


Version

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by