作业帮 > 综合 > 作业

matlab set找错

来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/04/20 10:16:59
matlab set找错
谁能告诉我下面的代码为什么最后一句出错
h1=figure;
x=[0 1 1 0 0];
y=[0 0 1 1 0];
fill(x,y,'y')
axis([-1 2 -1 2])
h2=figure;
theta=linspace(0,2*pi);
rho=sin(2*theta).*cos(2*theta);
polar(theta,rho,'r')
set(h2,'linewidth',3)
错误:
There is no 'linewidth' property in the 'figure' class.
Error in ==> exp at 102
set(h2,'linewidth',3)
clear;clc
x=[0 1 1 0 0];
y=[0 0 1 1 0];
h1=fill(x,y,'y')
axis([-1 2 -1 2])
figure
theta=linspace(0,2*pi);
rho=sin(2*theta).*cos(2*theta);
h2=polar(theta,rho,'r')
set(h2,'linewidth',3)