Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a=1.6;
- x=1.2:0.5:3.7;
- myFunction=@(x)(a.^(x.*x-1) - log10(x.*x - 1) + (x.*x-1).^(1/3));
- hold on;
- plot(x,myFunction(x), 'o');
- fplot(myFunction,[1.28,1.36]);
- fplot(myFunction,[1.36,2.47]);
- fplot(myFunction,[2.47,3.68]);
- fplot(myFunction,[3.68,4.56]);
- legend("show");
- --------------------
- x = 1.0:0.01:2.0;
- function y =myFunction(x)
- y = (5-x).^(1/3) - x;
- endfunction
- y = myFunction(x);
- Zero = fzero(@myFunction, 0.5)
- plot(x,y);
- --------------
- x=1;
- function y =myFunction(x)
- y = x * (1 - x.*x).^(1/2);
- endfunction
- x=fminbnd(@myFunction,-1.0, 0)
- y=myFunction(x)
- ----------------------
- x = [0.5;3.5];
- function z =myFunction(x)
- z = x(1)*x(1) + x(1)*x(2) + x(2)*x(2) - 3*x(1) - 6*x(2);
- endfunction
- [Min, funcMin]=sqp(x,@myFunction)
- ----------------
- ---------------
- x = 1.5:0.01:3.0;
- y = x.*x.*(1 + log(x));
- IntegrateTrapz = trapz(x, y)
- function y = myFunction(x)
- y = x.*x.*(1 + log(x));
- endfunction
- [IntegrateSimpson] = quadv(@myFunction,1.5,3.0,0.0025)
- ----------------
- A=[1 2 5 -11; 2 -6 -3 8; 3 4 5 1; 7 6 2 20];
- B= [7;11;15;-9];
- SLE=A\B
- SLE2=mldivide(A,B)
- [eigenvectors,eigenvalues]=eig(A)
- det(A)
- ---------------
- x = [-25 -23 -21 -18 -17.2 -15.4 -14];
- y = [0.76 0.74 0.61 0.58 0.84 0.92 1.22];
- p1 = polyfit(x, y, 1);
- p2 = polyfit(x, y, 5);
- p3 = polyfit(x, y, 7);
- XX = linspace(x(1), x(end), 100);
- y1 = polyval(p1, XX);
- y2 = polyval(p2, XX);
- y3 = polyval(p3, XX);
- plot(x, y, 's', XX, y1, XX, y2, XX, y3);
- legend ("show");
- ---------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement