Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.to create a serial number doesn't repeat
- N = fix(91*rand(1,10))+9
- 2.to empty a row or col
- X=magic(4)
- X(3,:)=[]
- 3.draw a tangent function
- t=-1.5:0.01:1.5
- y=tan(t);
- plot(t,y)
- 4.
- t = 0:pi/10:2*pi;
- plot(exp(i*t),'-o') % -o : plot circle ; -s : plot square
- axis equal
- -------------
- t = 0:pi/10:2*pi;
- x=3*cos(t);
- y=3*sin(t);
- plot(x,y)
- 5.
- save TD -ascii
- 6.load image and flip it
- load durer
- X=(X/5);
- image(X)
- Y=fliplr(X);
- image(Y)
- 7.root for polynomial x^3 + x + 1 = 0
- p=[1,0,1,1];
- x=roots(p)
- 8.find the numbers less than 0
- X=randn(4)
- size(X(find(X<0)),1)
- %k=find(X<0)
- %length(k)
- 9.find eigenvalue and eigenvector for a matrix
- x=magic(3)
- y=eig(x)
- det(x)
- v = ones(3,1)
- x*v
- 10.
- for i =1:sqrt(int_v)
- if 2^i >int_v
- break
- end
- end
- i
- ------------------------------------
- n=1;
- p=2^n;
- while (x>p)
- p=p*2;
- n=n+1;
- end
- n
Advertisement
Add Comment
Please, Sign In to add comment