【发布时间】:2015-06-25 05:19:53
【问题描述】:
最近 MATLAB 启用了绘图句柄以使用点表示法来设置属性。
例如
set(plotLeft,'marker','o');
现在可以
plotLeft(1).Marker = 'o';
是否可以使用这种新的点表示法一次设置多个字段。下面是一些代码示例:
clc; clear all;
x = logspace(-3,0,100)';
plot1 = sin(x);
plot2 = cos(x);
[hax,plotLeft,plotRight] = plotyy(x,[plot1 plot1],x,[plot2 plot2])
plotLeft(1).Marker = 'o';
plotLeft(2).Marker = 'x';
我想设置这个位:
plotLeft(1).Marker = 'o';
plotLeft(2).Marker = 'x';
但在一行中。我可以通过以下方式访问标记类型:
plotLeft([1 2]).Marker
但它不会让我设置它们我认为它会如何工作:
>> plotLeft([1 2]).Marker = ['o' 'x']
Insufficient number of outputs from function on right hand side of equal sign to
satisfy overloaded assignment.
【问题讨论】: