Different line style and color in cell

조회 수: 11 (최근 30일)
olodyusuf
olodyusuf 2020년 5월 19일
답변: Mehmed Saad 2020년 5월 19일
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.

답변 (1개)

Mehmed Saad
Mehmed Saad 2020년 5월 19일
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)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by