Is that possible to assemble several options and pass to the plot function in matlab

前端 未结 4 545
死守一世寂寞
死守一世寂寞 2021-01-20 00:58

I am using matlab to plot several figures and hope these figure use the same plot options. To be more specific, it looks something like this.

N = 20;
Fs = 20         


        
4条回答
  •  滥情空心
    2021-01-20 01:24

    The cell answer is good, another option is to set the arg value to be a variable:

    faceColor = 'b';
    lineWidth = 3;
    
    figure(1),clf;
    subplot(311);
    plot(t, x, 'bs-', 'MarkerFaceColor', faceColor, 'LineWidth', lineWidth);
    subplot(312);
    plot(t, y, 'bs-', 'MarkerFaceColor', faceColor, 'LineWidth', lineWidth);
    subplot(313);
    plot(t, z, 'bs-', 'MarkerFaceColor', faceColor, 'LineWidth', lineWidth);
    

提交回复
热议问题