Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- y=x^2*sin(x);
- deff('y=f(x)',['y=(x^2)*sin(x)'])
- x=[-5:0.1:5]
- fplot2d(x,f)
- deff('y=f(x)',['y=1/(1+%e^(1*x))'])
- fplot2d(x,f)
- deff('y=f(x)',['y=1/(1+%e^(2*x))'])
- fplot2d(x,f)
- deff('y=f(x)',['y=1/(1+%e^(3*x))'])
- fplot2d(x,f)
- x=[0:0.1:1]
- deff('y=f(x)',['y=x+1'])
- fplot2d(x,f)
- t=[0:0.1:2*%pi]
- polarplot(t,5*sin(3*t))
- linear
- A=[1 2 4 -1;0 1 2 0;3 1 1 -2]
- b=[21;8;16]
- C=[A b]
- A=[1 2 1;1 1 0;2 1 -1]
- b=[3;3;3]
- C=[A b]
- c=[1 2 1;1 1 0;2 1 -3]
- d=[3;3;3]
- rank(c)
- rank([c d])
- poly
- a=[10 5 -7 20]
- b=[-3 12 4]
- A=poly(a,'x','coeff')
- B=poly(b,'x','coeff')
- horner(A*B,3)
- a=[2 -4 3 1]
- b=[2 0 1]
- A=poly(a,'x','coeff')
- B=poly(b,'x','coeff')
- pdiv(A,B)
- a=input("Enter the coefficients of function 1:");
- b=input("Enter the coefficients of function 2:");
- p1=poly(a,'x','coeff');
- p2=poly(b,'x','coeff');
- r1=roots(p1);r2=roots(p2);
- disp("The first function is:")
- disp(p1);
- disp("and its root/s is/are:")
- disp(r1);
- disp("The second function is:")
- disp(p2);
- disp("and its root/s is/are:")
- disp(r2);
- a=input("Enter the coefficients of function 1:");
- b=input("Enter the coefficients of function 2:");
- p1=poly(a,'x','coeff');
- p2=poly(b,'x','coeff');
- sum=p1+p2
- diff=p1-p2
- disp("The sum is:")
- disp(sum);
- disp("The difference is:")
- disp(diff);
- stat
- x=input("Enter an array=>");
- a=mean(x)
- b=stdev(x)
- disp("mean");
- disp(a);
- disp("The standard deviation:");
- disp(b);
- [a,b]=reglin(x,y)
- w=[b a]
- z=poly(y,"x","coeff")
- r=correl(x,y)
- x=[3 5 4 3 1]
- y=[15 26 28 29 1]
- [a,b]=reglin(x,y)
- w=[b a]
- z=poly(w,"x","coeff")
- r=correl(x,y)
- x=[2 4 6 8 10]
- y=[15 20 25 30 35]
- function[k]=set(x,y);
- [a,b]=reglin(x,y)
- k=plot(x,y,'r', k,a*x+b,'y')
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement