Vous êtes sur la page 1sur 11

%-- 12/1/2013 9:58 PM --%

%-- 12/1/2013 9:59 PM --%


%-- 12/2/2013 4:06 PM --%
%-- 12/2/2013 4:07 PM --%
X=[17 8 12 15 6 11 9 18 16 10 13 19]
x=[17;8;12;15;6;11;9;18;16;10;13]
clc
x=[17,12]
clc
x={17 8 12 15 6 11 9 18 16 10 13 19}
x=[17 8 12 15 6 11 9 18 16 10 13 19]
size(x)
length(x)
whos
sum(x)
mean(x)
std(x)
diff(x)
format short g
format help
clc
%-- 12/2/2013 4:27 PM --%
t=[-25:25:1]
t=[-25:25:0]
t=[-25:25:51]
help linespace
help linspace
linspace(-25:25:51)
lt=inspace(-25:25:51)
t=linspace(-25:25:51)
t=linspace[-25:25:51]
t=linspace[-25,25,51}
t=linspace[-25,25,51]
t=linspace(-25,25,51)
x=t*.t
x=t.*
x=t.*t
size(t)
length(t)
whos(t)
x=t.*t
linspace(-25,25,51)
help plot
y=t(end:-1:1).^3
plot(t,x)
help subplot
sum(x(mod(x,2)==0))
sum(y(y>0))
sum(x(mod(x/2)==0)
sum(x(mod(x,2)==0)
sum(x(mod(x/2)==0))
sum(x(mod(x,2)==0))
help mod
clear all
clc
t=1:0.5:10
a = [3+ 4i 5 + 9i ? 3? 4i ? 5 ? 9i 3? 4i 5? 9i ? 3+ 4i ? 5+ 9i]
a = [3+ 4i 5 + 9i 3 4i 5 9i 3 4i 5 9i 3+ 4i 5+ 9i]
clc
clear all

c;c
c=0
end
end
;
'
%-- 12/2/2013 5:25 PM --%
a = [3+ 4i 5 + 9i ? 3? 4i ? 5 ? 9i 3? 4i 5? 9i ? 3+ 4i ? 5+ 9i]
%-- 12/2/2013 5:26 PM --%
a = [3+ 4i]
abs(a)
angle(a)
conj(a)
clc
%-- 12/4/2013 3:48 PM --%
thermo
help
thermo
help demo
help thermo
linmod(x)
help linmod
help sample
help sampling
bdwidth = 5;
topbdwidth = 10;
set(0,'Units','pixels')
screensize = get(0,'ScreenSize');
figwidth = screensize(3)/2 - 2*bdwidth;
figheight = screensize(4)/2 - 2*(bdwidth + topbdwidth);
pos1 = [bdwidth,...
bdwidth,...
figwidth,...
figheight];
pos2 = [screensize(3)/2+bdwidth,...
pos1(2),...
figwidth,...
figheight];
pos3 = [screensize(3)/2+bdwidth,...
screensize(4)/2+bdwidth,...
figwidth,...
figheight];
figure('Position',pos1)
figure('Position',pos2)
figure('Position',pos3)
x = [0 0 1 1 0
1 1 1 0 0
1 .5 .5 .5 .5
0 NaN NaN NaN NaN];
y = [0 1 1 0 0
0 1 0 0 1
1 .5 .5 .5 .5
1 NaN NaN NaN NaN];
z = [0 0 0 0 0
0 0 0 0 0
0 1 1 1 1
0 NaN NaN NaN NaN];
patch(x,y,z,'y')
view(3);xyz,box
function m = redblue(n)

if nargin < 1
n = size(get(gcf,'colormap'),1);
end
x = linspace(0,1,n);
redx = [0 .5 linspace(.5 + eps,1,100)];
redy = [.35 .78 fitrange(linspace(0,1).^6,.78,.85)];
red = interp1(redx,redy,x);
greenx = [0 .5 1];
greeny = [.5 .78 .35];
green = interp1(greenx,greeny,x);
bluex = [linspace(0,.5 - eps,100) .5 1];
bluey = [fitrange(-linspace(1,0).^6,.71,.78) .78 .3];
blue = interp1(bluex,bluey,x);
m = [red' green' blue'];
function m = redblue(n)
if nargin < 1
n = size(get(gcf,'colormap'),1);
end
x = linspace(0,1,n);
redx = [0 .5 linspace(.5 + eps,1,100)];
redy = [.35 .78 fitrange(linspace(0,1).^6,.78,.85)];
red = interp1(redx,redy,x);
greenx = [0 .5 1];
greeny = [.5 .78 .35];
green = interp1(greenx,greeny,x);
bluex = [linspace(0,.5 - eps,100) .5 1];
bluey = [fitrange(-linspace(1,0).^6,.71,.78) .78 .3];
blue = interp1(bluex,bluey,x);
m = [red' green' blue'];
function m = redblue(n)
if nargin < 1
n = size(get(gcf,'colormap'),1);
end
x = linspace(0,1,n);
redx = [0 .5 linspace(.5 + eps,1,100)];
redy = [.35 .78 fitrange(linspace(0,1).^6,.78,.85)];
red = interp1(redx,redy,x);
greenx = [0 .5 1];
greeny = [.5 .78 .35];
green = interp1(greenx,greeny,x);
bluex = [linspace(0,.5 - eps,100) .5 1];
bluey = [fitrange(-linspace(1,0).^6,.71,.78) .78 .3];
blue = interp1(bluex,bluey,x);
m = [red' green' blue'];
function m = redblue(n)
if nargin < 1
n = size(get(gcf,'colormap'),1);
end
x = linspace(0,1,n);
redx = [0 .5 linspace(.5 + eps,1,100)];
redy = [.35 .78 fitrange(linspace(0,1).^6,.78,.85)];
red = interp1(redx,redy,x);
greenx = [0 .5 1];
greeny = [.5 .78 .35];
green = interp1(greenx,greeny,x);
bluex = [linspace(0,.5 - eps,100) .5 1];
bluey = [fitrange(-linspace(1,0).^6,.71,.78) .78 .3];
blue = interp1(bluex,bluey,x);
m = [red' green' blue'];
%-- 12/4/2013 6:21 PM --%

% Draw a ship
shipgray = [.7 .75 .75];
% Hull:
vert = [...
-1
.7
0
0.8
0.8
0
1.3
0
0
0.8
-.8
0
-1
-.7
0
-1
1
1
1
1
1
1.5
0
1.2
1
-1
1
-1
-1
1];
vert(:,1) = 5*vert(:,1);
vert(:,3) = 0.7*vert(:,3);
faces = {...
[1 2 7 6];
[2 3 8 7];
[3 8 9 4];
[4 9 10 5];
[1 5 10 6];
[6 7 8 9 10];
[1 2 3 4 5]};
for i=1:size(faces,1)
patch('Vertices',vert,'Faces',faces{i},'FaceColor',shipgray,...
'EdgeColor',0.5*shipgray)
end
%for i=1:size(faces,1)
% patch('Vertices',vert,'Faces',faces{i},'FaceColor','none',...
%
'EdgeColor',0.5*shipgray)
%end
% Superstructure:
neck = 0.5;
vert = [...
-1
1
0
-.6
1
0
-.2
(1 - neck)
0
.2
(1 - neck)
0
.6
1-neck/2
0
1
1-neck/2
0
1
-(1-neck/2)
0
.6
-(1-neck/2)
0
.2
-(1 - neck)
0
-.2
-(1 - neck)
0
-.6
-1
0
-1
-1
0
-1
1
1
-.6
1
1
-.2
(1 - neck)
1
.2
(1 - neck)
1
.6
1-neck/2
1
1
1-neck/2
1
1
-(1-neck/2)
1
.6
-(1-neck/2)
1
.2
-(1 - neck)
1
-.2
-(1 - neck)
1
-.6
-1
1
-1
-1
1];
vert(:,1) = 3*vert(:,1) + 1;

vert(:,3) = 0.8*vert(:,3) + .7;


faces = [...
1 2 14 13
2 3 15 14
3 4 16 15
4 5 17 16
5 6 18 17
6 7 19 18
8 7 19 20
9 8 20 21
10 9 21 22
11 10 22 23
12 11 23 24
1 12 24 13];
patch('Vertices',vert,'Faces',faces,'FaceColor',shipgray,...
'EdgeColor',0.5*shipgray)
faces = 13:24;
patch('Vertices',vert,'Faces',faces,'FaceColor',shipgray,...
'EdgeColor',0.5*shipgray)
view(26,30)
axis equal vis3d
%-- 12/4/2013 6:21 PM --%
%-- 12/4/2013 6:22 PM --%
col=30;
m=400;
cx=0;
cy=0;
l=1.5;
x=linspace(cx-l,cx+l,m);
y=linspace(cy-l,cy+l,m);
[X,Y]=meshgrid(x,y);
c= -.745429;
Z=X+i*Y;
for k=1:col;
Z=Z.^2+c;
W=exp(-abs(Z));
end
colormap prism(256)
pcolor(W);
shading flat;
axis('square','equal','off');
function y = factorial(x)
if x==0
y = 1;
else
[m,n] = size(x);
y = zeros(size(x));
for i=1:m
for j=1:n
y(i,j) = prod(1:x(i,j));
end
end
end
clc
function b = blue(m)
if nargin < 1, m = size(get(gcf,'colormap'),1); end
b = [ zeros(m,2) linspace(0,1,m)'];
%-- 12/4/2013 6:32 PM --%
clc
whos

plot(sine60)
stem(sine60)
plot(sine60(
plot(sine60)
stem(sine60)
help stem
stem(sine60)
whos
plot(sine60)
stem(sine60)
plot(sine60)
plot(jad)
whos
plot(sine60)
stem(sine60)
help stem
plot(tout,sine60), grid on
help plot
plot(tout,sine60), grid on
cx=0;clc
plot(tout,sine60), grid on
clc
Fs = 8000; % set the sampling rate
T = 1/Fs; % sample interval
tfinal = 4; % length of time
k = 0:tfinal/T; % index vector
f = 440;
% signal is at 440 Hz (concert 'A')
sig = 0.2*cos(2*pi*f*k*T); % generate samples of the sinusoidal signal
Fs = 8000; % set the sampling rate
T = 1/Fs; % sample interval
tfinal = 4; % length of time
k = 0:tfinal/T; % index vector
f = 440;
% signal is at 440 Hz (concert 'A')
sig = 0.2*cos(2*pi*f*k*T); % generate samples of the sinusoidal signal
Fs = 8000; % set the sampling rate
T = 1/Fs; % sample interval
tfinal = 4; % length of time
k = 0:tfinal/T; % index vector
f = 440;
% signal is at 440 Hz (concert 'A')
sig = 0.2*cos(2*pi*f*k*T); % generate samples of the sinusoidal signal
sound(sig,Fs); % Play the signal (at 8000 samples/sec)
clc
Fs = 250; % set the sampling rate
T = 1/Fs; % sample interval
tfinal = 10; % length of time
k = 0:tfinal/T; % index vector
f = 440;
% signal is at 440 Hz (concert 'A')
sig = 10*cos(2*pi*100); % generate samples of the sinusoidal signal
imshow(sig)
plot(sig)
stem(sig)
Fs = 250; % set the sampling rate
T = 1/Fs; % sample interval
tfinal = 10; % length of time
f = 250;
% signal is at 250 Hz (concert 'A')
sig = 10*cos(2*pi*100); % generate samples of the sinusoidal signal
%-- 12/5/2013 10:01 PM --%
SIMOUT
simout
yout

tout
yout
tout
yout
tout
'clc
clc
%-- 12/9/2013 10:33 AM --%
A=imread('imageA.bmp');
a="ima
script
clc
script
ch2s12
ch2s13
ch2s17
%-- 12/9/2013 12:17 PM --%
clc
help fft
%-- 12/9/2013 11:17 PM --%
%-- 12/10/2013 8:07 AM --%
%-- 12/10/2013 7:03 PM --%
%-- 12/15/2013 4:03 PM --%
%-- 12/17/2013 8:06 AM --%
%-- 12/17/2013 11:08 PM --%
%-- 12/18/2013 6:27 PM --%
y=10cos(2*pi*x);
plot(x,y);
y=10cos(2*pi*x);
y=10*cos(2*pi*x);
x=[0,1]; y=sin(2*pi*x);
plot(x,y);
clc
function y=sins(a)
x = (-pi:(0.1/a):pi);
y = sin(x);
plot(x,y)
figure
stem(x,y)
end
clc
function y=sins(a)
x = (-pi:(0.1/a):pi);
y = sin(x);
plot(x,y)
figure
stem(x,y)
end
function y=sin(a)
x = (-pi:(0.1/a):pi);
y = sin(x);
plot(x,y)
figure
stem(x,y)
end
function y=sine(a)
x = (-pi:(0.1/a):pi);
y = sine(x);
plot(x,y)
figure

stem(x,y)
end
sin
sine
sin
sin help
sinus
sclc
clc
function y=sin(a)
x = (-pi:(0.1/a):pi);
y = sin(x);
plot(x,y)
figure
stem(x,y)
end
function y=sin(a)
x = (-pi:(0.1/a):pi);
y = sin(x);
plot(x,y)
figure
stem(x,y)
end
y=sin(a)
x = (-pi:(0.1/a):pi);
y = sin(x);
plot(x,y)
figure
stem(x,y)
end
function y=sinx(n);
x =(-n*pi:0.1:n*pi);
y = sin(x);
subplot(2,2,1)
plot(x,y,'r')
ylabel('sin(x)')
z=cos(x);
subplot(2,2,2)
plot(x,z)
ylabel('cos(x)')
w=asin(x);
subplot(2,2,3)
plot(x,w)
ylabel('asin(x)')
subplot(2,2,4)
k=(sin(x))./x;
plot(x,k,'r')
ylabel('sin(x)/x)')
end
x=[-10:1:10]
plot(x,cos(x))
%-- 12/24/2013 1:36 AM --%
a=[1 1 0 ; 1 1 1 ; 0 0 0 ;1 0 1 ;];
a
figure(1);imshow(a)
aa=1-a
figure(2);imshow(aa)
a=[1 1 0 ; 1 1 1 ; 0 0 0 ;1 0 1 ;];
a
figure(1);imshow(a)

aa=1-a
figure(2);imshow(aa)
%-- 12/24/2013 11:54 AM --%
%-- 12/24/2013 5:28 PM --%
x=[1 2 3 ]
x=[1;2;3]
whos x
y=[1 2 3]
whos y
clc
x=0:1:9
y=0:2:9;
y=0:2:9
length(x)
length(y)
x(6)
x(5)
x(end)
x0:1;9
x=0;1;9
x=0:1:9
z=x(2:5)
x(y(3))
clc
clear all
clcl
clc
x=linspae(0,1,11)
clc
linspace(0,1,11)
x=linspace(0,1,9)
linspace(0,1,11)
x=0:1:9
linspace(0:0.1:1)
linspace(0,1,11)
clc
fft help
help fft
clc
linspace(0,1,10)
clc
linspace(0,1,10)
clc
end-start/nb-1
clc
end
clc
end;
endl
clc
end=[0 1 2]
clc
x(1)
y=[x(1) x(2)]
y=[x(1);x(2)]
z=x([9 10 11])
z=x[[9 10 11]]
clc
z=x(9:11)
f=x(end-2:end)

z=x(lenght(x)-2:lenght(x))
z=x(length(x)-2:length(x))
z=(end-2:end)
z=[end-2:end]
z=x(end-2:end)
clc
%-- 12/24/2013 6:46 PM --%
x=[1;4;6]
clear all
clc
x=[1,4,6]
y=[2;3;4]
whos
clc
x=linspace(0,9,11)
x=linspace(0,9,10)
clc
x=linspace(0,9,10)
x=0:1:9
clc
length(X)
length(x)
clc
length(x)
x(6)
x(end)
clc
y=0:2:9
x(y(3))
clc
x=[1 4 6 -2]
y=[3 6 8 1]
z=[1;2;3;4]
w=[3 4 1]
clc
t=x+y
t=x*z
t=x.*y
sum(X)
sum(x)
prod(x)
clc
%-- 12/24/2013 11:05 PM --%
clc
a=[1 2 3 ; -1 4 1]
b=[6 6 6 ; 3 3 3 ]
b'
a'
c=a+b
d=a'+b'
size(a')
size(b')
CLC
clc
d=[a:b]
clc
d=[a;b]
A=[00111 ;111111 ;000000 ;101010];
imshow(A)
clc

A=[0 0 1 1 1 1; 1 1 1 1 11 1 ;0 0 0 0 0 0 ;1 0 1 0 1 0];
imshow(A)
B=[1 1 0 0 ; 0 0 0 0 ; 1 1 1 1 ; 0 0 1 1];
imshow(B)
C=[A;B]
clc
d=a*c
d=a.*c
C=[A , B]
A'
A
AA=[0 0 1 1 1 1; 1 1 1 1 1 1 ;0 0 0 0 0 0 ;1 0 1 0 1 0]
A=[0 0 1 1 1 1; 1 1 1 1 1 1 ;0 0 0 0 0 0 ;1 0 1 0 1 0]
a'
A'
clc
%-- 12/24/2013 11:56 PM --%
A=[0 0 0 0 0 1 1 1 1 1 ;0 0 0 0 0 1 1 1 1 1;0 0 0 0 0 1 1 1 1 1;0 0 0 0 0 1
1 1 1 1;0 0 0 0 0 1 1 1 1 1;0 0 0 0 0 1 1 1 1 1;0 0 0 0 0 1 1 1 1 1;0 0 0 0 0
1 1 1 1 1;0 0 0 0 0 1 1 1 1 1;0 0 0 0 0 1 1 1 1 1]
clc
a=[0 0 1 1 1 1;1 1 1 1 1 1; 0 0 0 0 0 0;1 0 1 0 1 0]
imshow (a)
b=[1 1 0 0; 0 0 0 0; 1 1 1 1; 0 0 1 1]
imshow (b)
c=[a,b]
imshow (c)
e=[0 0 0 0 0 1 1 1 1 1; 0 0 0 0 0 1 1 1 1 1 ;0 0 0 0 0 1 1 1 1 1 ;0 0 0 0 0 1 1
1 1 1 ;0 0 0 0 0 1 1 1 1 1 ; 1 1 1 1 1 0 0 0 0 0; 1 1 1 1 1 0 0 0 0 0; 1 1 1 1 1
0 0 0 0 0; 1 1 1 1 1 0 0 0 0 0; 1 1 1 1 1 0 0 0 0 0]
imshow(e)
a=(3,2)
e(3,2)
e(6,2)
imshow(e)
size(e)
c=e(:,1)
d=e(:,7)
imshow (c)
imshow (d)
f=e(3,:)
imshow(f)
f=e(:,4:6)
imshow (f)
f=e(4:7,4:7)
imshow (f)
e(1:end-1,1:end-1)
imshow (e)
e(2:end,2:end)
imshow(e)
%-- 12/1/2013 9:58 PM --%

Vous aimerez peut-être aussi