Different line style and color in cell
1 回表示 (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
回答 (1 件)
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)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!