Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

A (6 Eye (6) +diag (Ones (1,5), 1) +5 Diag (Ones (1,1), 5) 2 Ones (3,3) 8 Eye (3) )

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

1.

A=[6*eye(6)+diag(ones(1,5),1)+5*diag(ones(1,1),5);2*ones(3,3) 8*eye(3)]
2. x=1:0.1:20;
y1=inline('exp(2.*x).*sin(2*x)')
y2=inline('(x-3)/(x.^2+1)')
y3=inline('x.*cos(x.^2+1)')

subplot(1,3,1);
plot(y1(x));
subplot(1,3,2);
plot(y2(x));
subplot(1,3,3)
plot(y3(x));

1.
x=-25:10;
j=1;
for i=1:length(x)
if mod(x(i),2)==1
y(j)=x(i);
j=j+1;
end
y
end

j=1;
for i=length(x):-1:1
xi(j)=x(i);
j=j+1;
end;
xi

2.pas

1. A=[2*eye(6)+diag(ones(1,5),1)+4*diag(ones(1,5),-
1)+3*diag(ones(1,3),-3) [5*ones(3,3);7*eye(3)]]
2. x=1:0.1:20;
y1=inline('exp(2./x).*sin(2.*x)')
y2=inline('x.*sin(x.^2+1)')
y3=inline('(x.^2+1).*atan(x)')

subplot(1,3,1);
plot(y1(x));
subplot(1,3,2);
plot(y2(x));
subplot(1,3,3)
plot(y3(x));

1.a a(1:3,2)
b. b(1,end),b(1,1),…
c. a(:,1 3 4)=b(:,1:3)
function w=fct(v,i)

w(i)=v(i-1)+v(i+1)
end
1. function w=fct(v,i)

w(i)=v(i-1)+v(i+1)
end

2. x=-10:0.1:10;

>> z=x.*sin(x);

>> cylinder(z)

>> colormap(summer)
1. >> f=inline('1./(1+exp(-3.*x))');

>> x=0.5;

>> f(x)

>> x=[-2 1.25 0];

>> f(x)

2. >> x=-pi:0.1:pi;

>> y=-pi:0.1:pi;

>> [X,Y]=meshgrid(x,y);

>> Z=X.*sin(x).*cos(y);

>> surf(X,Y,Z);

>> colormap(winter);
>> hold

Current plot held

>> contour(X,Y,Z)

1. function x=fct5(n)

x=randperm(n);
y((x>=5)&(x<=20))=x((x>=5)&(x<=20))-4;
plot(x,y,'ro');
end

2. x(mod(x,5)==0)
1. function w=fct5(v)

v=input('v=');
for i=1:length(v)-1
w(i)=2.*v(i)+v(i+1);
end;
fid=fopen('calcul.txt','w');
fprintf(fid,'%6.2f ',w);
fclose(fid);
c=load('calcul.txt');
end
2. rc=1.25;
h=3;
n=6;
[xp,yp,z]=cylinder([rc 0],n)
zp=h*z;
surf(xp,yp,zp);
colormap(spring);
axis('equal')

x=0:0.2:2;
y=x-3;
cylinder(y,300);
colormap(spring);

You might also like