我有两个轴:一个用于查看图像,另一个用于绘制图形。当我尝试指定要在哪些轴上绘制数据时出现此错误:Error using plot. A numeric or double convertible argument is expected
尝试plot(handles.axis,curve,x,y)
.
figure
handles.axis = gca;
x = 1:10;
y = 1:10;
curve = fit(x',y','linearinterp');
plot(curve,x,y) % works fine
plot(handles.axis,curve,x,y) % doesn't work
plot(curve,x,y,'Parent',handles.axis) % doesn't work
您可以将此示例粘贴到 Matlab 中进行尝试。如何更正代码以指定轴?