ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

matlab实验6

2022-05-17 15:32:41  阅读:39  来源: 互联网

标签:10 log interp1 sum sqrt 实验 matlab inline


 

1.

a=randn(10,5)+10;

ma=max(max(a))

mi=min(min(a))

s=sum(a,2) sa=sum(sum(a))

P=sort(a)

p1=sort(-a,2)

2.

n=(1:10).^2;
f=sqrt(n);
interp1(n,f,(1:100),'cubic')

3.

n=6:2:18;
f1=[18 20 22 25 30 28 24];
f2=[15 19 24 28 34 32 30];
r=6.5:2:17.5;
w=interp1(n,f1,r,'spline');
w1=interp1(n,f2,r,'spline');
subplot(211),plot(r,w)
subplot(212),plot(r,w1)

4.

x=linspace(1,101,10);
y=log(x)/log(10);
p=polyfit(x,y,5)
y1=polyval(p,x)
plot(x,y,':o',x,y1,'-*')
legend('sin(x)','fit')

5.

p1=[12405];
p2=[00012];
p3=[00123];
p=p1+p2+p3
r=roots(p)
a=[-1 1.2 -1.4; 0.75 2 3.5; 0 5 2.5];
s=polyval(p,a)

6.

f=inline('sqrt(x.^2+1)');

x=1:3;

dx=diff(f([x,4]))/1

7.

I1=inline('sqrt((cos(t)).^2+4*sin(2*t).^2+1)','t');

quad(I1,0,2*pi) I2=inline('log(1+x)./(1+x.^2)','x');

quad(I2,0,1)

 

标签:10,log,interp1,sum,sqrt,实验,matlab,inline
来源: https://www.cnblogs.com/lyf3701/p/16280976.html

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有