求matlab画二元函数图象:(sqrt(1-y^2)-sqrt(1-x^2))*(x+y) (0要那个matlab编码
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 07:46:09
求matlab画二元函数图象:(sqrt(1-y^2)-sqrt(1-x^2))*(x+y) (0要那个matlab编码
求matlab画二元函数图象:(sqrt(1-y^2)-sqrt(1-x^2))*(x+y) (0
要那个matlab编码
求matlab画二元函数图象:(sqrt(1-y^2)-sqrt(1-x^2))*(x+y) (0要那个matlab编码
clear
x=linspace(0,1,101); %根据题意,x>0;且x应该<1,否则出现复数解
y=linspace(-1,1,101); %-1<y<1
[X,Y]=meshgrid(x,y);
Z=zeros(101,101);
for i=1:101
for j=1:101
if y(j)<x(i)
Z(i,j)=(sqrt(1-Y(j)^2)-sqrt(1-X(i)^2))*(X(i)+Y(j));
else
Z(i,j)=NaN; %不满足y<x的值设为空(不是零哦亲)
end
end
end
surf(X,Y,Z)
xlabel('X')
ylabel('Y')
view(30,15)
clear
clc
[X,Y]=meshgrid(0:0.02:1);
Z=(sqrt(1-Y.^2)-sqrt(1-X.^2)).*(X+Y);
for n=1:1:50
Z(n+1:51,n)=NaN;
end
surf(X,Y,Z)
clear x=linspace(0,1,101); %根据题意,x>0;且x应该<1,否则出现复数解 y=linspace(-1,1,101); %-1<y<1 [X,Y]=meshgrid(x,y); Z=zeros(101,101); for i=1:101
全部展开
clear x=linspace(0,1,101); %根据题意,x>0;且x应该<1,否则出现复数解 y=linspace(-1,1,101); %-1<y<1 [X,Y]=meshgrid(x,y); Z=zeros(101,101); for i=1:101 for j=1:101 if y(j)<x(i) Z(i,j)=(sqrt(1-Y(j)^2)-sqrt(1-X(i)^2))*(X(i)+Y(j)); else Z(i,j)=NaN; %不满足y<x的值设为空(不是零哦亲) end end end surf(X,Y,Z) xlabel('X') ylabel('Y') view(30,15)
收起