Lab 1: Introduction to Scilab
Console
--> (7+5*2)/sqrt(8-2)
ans =
6.9402209
--> ans-sqrt(77)
ans =
-1.8347434
--> (ans)^2
ans =
3.3662835
--> sin(%pi/2)+(2*cos(%pi))
ans =
-1.
--> (%e)^(-%i*%pi)
ans =
-1. - 1.225D-16i
--> J=[2 1 7;7 1 2;10 12 17];A=[12 11 17;17 12 21;10 1 9]
A =
12. 11. 17.
17. 12. 21.
10. 1. 9.
--> J+A
ans =
14. 12. 24.
24. 13. 23.
20. 13. 26.
--> J-A
ans =
-10. -10. -10.
-10. -11. -19.
0. 11. 8.
--> A^2
ans =
501. 281. 588.
618. 352. 730.
227. 131. 272.
--> J^2
ans =
81. 87. 135.
41. 32. 85.
274. 226. 383.
--> for i=1:3
> for p=1:3
> J(i,p)*A(i,p)
> end
> end
ans =
24.
ans =
11.
ans =
119.
ans =
119.
ans =
12.
ans =
42.
ans =
100.
ans =
12.
ans =
153.
--> for i=1:3
> for p=1:3
> J(i,p)/A(i,p)
> end
> end
ans =
0.1666667
ans =
0.0909091
ans =
0.4117647
ans =
0.4117647
ans =
0.0833333
ans =
0.0952381
ans =
1.
ans =
12.
ans =
1.8888889
--> for i=1:3
> for p=1:3
> J(i,p)^A(i,p)
> end
> end
ans =
4096.
ans =
1.
ans =
2.326D+14
ans =
2.326D+14
ans =
1.
ans =
2097152.
ans =
1.000D+10
ans =
12.
ans =
1.186D+11
--> inv(A)
ans =
-1.0875 1.025 -0.3375
-0.7125 0.775 -0.4625
1.2875 -1.225 0.5375
--> inv(J)
ans =
-0.017284 0.1654321 -0.0123457
-0.2444444 -0.0888889 0.1111111
0.182716 -0.0345679 -0.0123457
--> R=[1 2 4;13 11 21;3 8 12]
R =
1. 2. 4.
13. 11. 21.
3. 8. 12.
--> R(2,:)
ans =
13. 11. 21.
--> R(:,3)
ans =
4.
21.
12.
--> X= 2:2:50
X =
column 1 to 15
2. 4. 6. 8. 10. 12. 14. 16. 18. 20. 22. 24. 26. 28. 30.
column 16 to 25
32. 34. 36. 38. 40. 42. 44. 46. 48. 50.
--> Y= 1:2:49
Y =
column 1 to 16
1. 3. 5. 7. 9. 11. 13. 15. 17. 19. 21. 23. 25. 27. 29. 31.
column 17 to 25
33. 35. 37. 39. 41. 43. 45. 47. 49.
--> t=(0:0.1:2*%pi);
--> v=sin(t)+cos(t);
--> plot(t,v);
WARNING: Mouse moving picker ON => Console LOCKED
On a figure: Click left to get and set. Click middle to QUIT...
--> // Moving picker OFF => Back to the console.