Advertisement
lossyy

scilab1

Feb 19th, 2021
2,361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scilab 1.17 KB | None | 0 0
  1. //lab1maznev.sce
  2. //6+8
  3.  
  4. 2.35*(1.8-0.25)+1.34^2/3.12
  5.  
  6. 1+2+3+4+5+6...
  7. 7+8+9+10+...
  8. +11+12+13
  9.  
  10. 1+2;
  11. 1+2
  12.  
  13. a=2.3
  14. b=-34.7
  15. x=1;y=2;z=(x+y)-a/b
  16. c+3/2
  17. c='a'
  18. h='мама мыла раму'
  19.  
  20. x=3; y=-1;
  21. clear x
  22. y
  23. a=1;b=2;
  24. clear;
  25. a
  26. b
  27.  
  28. 25.7-3.14
  29. 2*ans
  30. x=ans^0.3
  31. ans
  32.  
  33. a=5.4; b=0.1;
  34. F=cos(%pi/3)+(a-b)*%e^2
  35.  
  36. sin(pi/2)
  37.  
  38. 0.123
  39. -6.42e+2
  40. 3.2e-6
  41.  
  42. %pi
  43. q=0123.4567890123456
  44.  
  45. printf("%1.12f",%pi)
  46. printf("%1.2f",q)
  47. printf("%f",q)
  48.  
  49. x=1.2; y=0.3;
  50. z=sqrt(abs(sin(x/y)))*exp(x^y)
  51.  
  52. deff('z=fun1(x,y)', 'z=sqrt(abs(sin(x/y)))*exp(x^y)');
  53. x=1.2;y=0.3;z=fun1(x,y)
  54.  
  55. deff('S=G(a,b,c)','p=(a+b+c)/2;S=sqrt((p-a)*(p-b)*(p-c))');
  56. G(2,3,3)
  57.  
  58. deff('[x1,x2]=korni(a,b,c)','d=b^2-4*a*c;x1=(-b+sqrt(d))/2/a;x2=(-b-sqrt(d))/2/a');
  59. [x1,x2]=korni(-2,-3,-5)
  60.  
  61. exec('D:\cubMaznev.sce');
  62. disp('execdone');
  63. [x1,x2,x3]=cub(3,-20,-3,4)
  64.  
  65. //cub.sce
  66. function[x1,x2,x3]=cub(a,b,c,d)
  67.     r=b/a;
  68.     s=c/a;
  69.     t=d/a;
  70.     p=(3*s-r^2)/3;
  71.     q=2*r^3/27-r*s/3+t;
  72.     D=(p/3)^3+(q/2)^2;
  73.     u=(-q/2+sqrt(D))^(1/3);
  74.     v=(-q/2-sqrt(D))^(1/3);
  75.     y1=u+v;
  76.     y2=-(u+v)/2+(u-v)/2*%i*sqrt(3);
  77.     y3=-(u+v)/2-(u-v)/2*%i*sqrt(3);
  78.     x1=y1-r/3;
  79.     x2=y2-r/3;
  80.     x3=y3-r/3;
  81. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement