1个回答
展开全部
%% 1
% (1)
str=cell(1,3);
str{1}='chen'; str{2}='chang'; str{3}='han';
A=zeros(3,5);
for i=1:3
lth=length(str{i});
A(i,1:lth)=abs(str{i})-abs('a')+1;
end
%(2)
B=A'*A
det(B)
%(3)
help sum
%sum(A,2)表示求A中每一行的和
%(4)
b=A'*sum(A,2)
x=B\b
%% 2
%(1)
x=-pi:0.1:pi;
plot(x,sin(x),'r-',x,cos(x),'b.--')
%(2)
a=1;b=2;
syms x y
ezplot(x^2/a-y^2/b-1)
%(3)
ezplot3('sin(t)','cos(t)','t')
%(4)
a=4;b=1;c=3;
syms alph beta
ezmesh(a*cos(alph)*sin(beta),b*cos(alph)*sin(beta),c*cos(beta),[0 2*pi 0 2*pi])
%(5)
ezsurfc('cos(x).*sin(y)')
% (1)
str=cell(1,3);
str{1}='chen'; str{2}='chang'; str{3}='han';
A=zeros(3,5);
for i=1:3
lth=length(str{i});
A(i,1:lth)=abs(str{i})-abs('a')+1;
end
%(2)
B=A'*A
det(B)
%(3)
help sum
%sum(A,2)表示求A中每一行的和
%(4)
b=A'*sum(A,2)
x=B\b
%% 2
%(1)
x=-pi:0.1:pi;
plot(x,sin(x),'r-',x,cos(x),'b.--')
%(2)
a=1;b=2;
syms x y
ezplot(x^2/a-y^2/b-1)
%(3)
ezplot3('sin(t)','cos(t)','t')
%(4)
a=4;b=1;c=3;
syms alph beta
ezmesh(a*cos(alph)*sin(beta),b*cos(alph)*sin(beta),c*cos(beta),[0 2*pi 0 2*pi])
%(5)
ezsurfc('cos(x).*sin(y)')
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询