SciLab Tugas 1
SciLab Tugas 1
SciLab Tugas 1
--> 123+456
ans =
579.
--> 14.56*(1+0.0043*80)
ans =
19.56864
--> 2/sqrt(5^2=16%pi-1/40*%pi))^2)
2/sqrt(5^2=16%pi-1/40*%pi))^2)
^^
Error: syntax error, unexpected =, expecting "," or )
--> 2/sqrt(5^2+16%pi-1/40*%pi))^2)
2/sqrt(5^2+16%pi-1/40*%pi))^2)
^~~~~^
Error: syntax error, unexpected identifier, expecting end of file
--> 2/sqrt(5^2+16*%pi-1/40*%pi))^2)
2/sqrt(5^2+16*%pi-1/40*%pi))^2)
^^
Error: syntax error, unexpected ), expecting end of file
--> 2/sqrt(5^2+16*%pi-1/(40*%pi))^2)
2/sqrt(5^2+16*%pi-1/(40*%pi))^2)
^^
Error: syntax error, unexpected ), expecting end of file
--> 2/sqrt(5^2+16*%pi-1/(40*%pi)^2)
ans =
0.2305325
--> 2+9
ans =
11.
--> 23+9
ans =
32.
--> FV=500*(1+5/100)^4
FV =
607.75313
--> FV
FV =
607.75313
--> v=120;R=240;I=v/R,P=V*I
I =
0.5
Undefined variable: V
--> V=120;R=240;I=V/R,P=V*I
I =
0.5
P =
60.
ans =
ans =
ans =
T
-->
/Users/madiotistrom
--> e5=1+1/1+1/(1*2)+1/(1*2*3)+...
> 1/(1*2*3*4*5)
e5 =
2.675
--> f6=1+1/(1*2)+...
> 1/(1*2*3*4*5*6*7)
f6 =
1.5001984
--> d=53//jarak(m)
d =
53.
15.
--> v=d/t
v =
3.5333333
--> 3e8
ans =
3.000D+08
--> 2.778E-4
ans =
0.0002778
--> 1.660d-27
ans =
1.660D-27
--> -9.87D34
ans =
-9.870D+34
--> A=(1,2,3,4,5)//NUM
--> A=(1,2,3,4,5)//NUM
--> A=(1,2,3:4,5,6)//NUM
--> A=(1,2,3:4,5,6)//number
--> A=(1,2,3;4,5,6)//number
A=(1,2,3;4,5,6)//number
^
Error: syntax error, unexpected ;, expecting "," or )
--> test
1. 2. 3.
4. 5. 6.
--> test=1001<999
test =
--> x=5;(x>=0)&(x<=10)
ans =
-->
--> n=exp(4)
n =
54.59815
--> rand()
ans =
0.2113249
--> date()
ans =
12-Feb-2020
--> foo 3
in builtin foo
--> funcprot(0)
ans =
1.
--> foo 1
in builtin foo
--> foo(4)
ans =
3.9816844
--> %i
%i =
--> sin(pi/2)
Undefined variable: pi
--> sin(%pi/2)
ans =
1.
--> log(%e)
ans =
1.
--> %i^2
ans =
-1.
--> abs(-28.9)
ans =
28.9
--> abs(3-4*%I)
Undefined variable: %I
--> abs(3-4*%i)
ans =
5.
--> sign(56,78)
--> sign(56.78)
ans =
1.
--> clean
--> sind
at line 7 of function sind ( /Applications/scilab-
6.0.2.app/Contents/MacOS/share/scilab/modules/elementary_functions/macros/sind.sci
line 21 )
0.7071068
--> acosd(1)
ans =
0.
--> nextpow2(20)
ans =
5.
--> log10(100)
ans =
2.
--> fibonacci(5)
--> fibonacci(5)
--> *fibonacci(5)
*fibonacci(5)
^^
Error: syntax error, unexpected *
--> fibonacci(5)
--> fibonacci(5)
--> fibonacci(5)
> f= ones(1,n);
^^
Error: syntax error, unexpected >
> f= ones(1,n);
^^
Error: syntax error, unexpected >
--> fibonacci(5)
--> fibonacci(5)
ans =
1. 1. 2. 3. 5.
--> x=linspace(-5,5,2000);
--> y=(x-1).*(x-2).*(x+3).*(x-4);
--> plot2d(x,y)
--> x=linspace(0,5,10);y=x;
--> [X,Y]=meshgrid(x,y)
Y =
column 1 to 8
0. 0. 0. 0. 0. 0. 0. 0.
0.5555556 0.5555556 0.5555556 0.5555556 0.5555556 0.5555556 0.5555556
0.5555556
1.1111111 1.1111111 1.1111111 1.1111111 1.1111111 1.1111111 1.1111111
1.1111111
1.6666667 1.6666667 1.6666667 1.6666667 1.6666667 1.6666667 1.6666667
1.6666667
2.2222222 2.2222222 2.2222222 2.2222222 2.2222222 2.2222222 2.2222222
2.2222222
2.7777778 2.7777778 2.7777778 2.7777778 2.7777778 2.7777778 2.7777778
2.7777778
3.3333333 3.3333333 3.3333333 3.3333333 3.3333333 3.3333333 3.3333333
3.3333333
3.8888889 3.8888889 3.8888889 3.8888889 3.8888889 3.8888889 3.8888889
3.8888889
4.4444444 4.4444444 4.4444444 4.4444444 4.4444444 4.4444444 4.4444444
4.4444444
5. 5. 5. 5. 5. 5. 5. 5.
column 9 to 10
0. 0.
0.5555556 0.5555556
1.1111111 1.1111111
1.6666667 1.6666667
2.2222222 2.2222222
2.7777778 2.7777778
3.3333333 3.3333333
3.8888889 3.8888889
4.4444444 4.4444444
5. 5.
X =
column 1 to 8
0. 0.5555556 1.1111111 1.6666667 2.2222222 2.7777778 3.3333333 3.8888889
0. 0.5555556 1.1111111 1.6666667 2.2222222 2.7777778 3.3333333 3.8888889
0. 0.5555556 1.1111111 1.6666667 2.2222222 2.7777778 3.3333333 3.8888889
0. 0.5555556 1.1111111 1.6666667 2.2222222 2.7777778 3.3333333 3.8888889
0. 0.5555556 1.1111111 1.6666667 2.2222222 2.7777778 3.3333333 3.8888889
0. 0.5555556 1.1111111 1.6666667 2.2222222 2.7777778 3.3333333 3.8888889
0. 0.5555556 1.1111111 1.6666667 2.2222222 2.7777778 3.3333333 3.8888889
0. 0.5555556 1.1111111 1.6666667 2.2222222 2.7777778 3.3333333 3.8888889
0. 0.5555556 1.1111111 1.6666667 2.2222222 2.7777778 3.3333333 3.8888889
0. 0.5555556 1.1111111 1.6666667 2.2222222 2.7777778 3.3333333 3.8888889
column 9 to 10
4.4444444 5.
4.4444444 5.
4.4444444 5.
4.4444444 5.
4.4444444 5.
4.4444444 5.
4.4444444 5.
4.4444444 5.
4.4444444 5.
4.4444444 5.
--> z=X.^2-Y.^2
z =
column 1 to 8
column 9 to 10
19.753086 25.
19.444444 24.691358
18.518519 23.765432
16.975309 22.222222
14.814815 20.061728
12.037037 17.283951
8.6419753 13.888889
4.6296296 9.8765432
0. 5.2469136
-5.2469136 0.
--> clf();f=scf(0)
f =
--> surf(X,Y,Z)
Undefined variable: Z
--> x=linspace(0,5,10);y=x;
--> [X,Y]=meshgrid(x,y);
--> z=X.^2-Y.^2;
--> clf();f=scf(0);
--> surf(X,Y,Z)
Undefined variable: Z
--> surf(X,Y,z)
--> f.colour_map=hsvcolormap(32)
--> f.colour_map=hsvcolormap(32);
--> x=linspace(0,5,10);y=x;
--> [X,Y]=meshgrid(x,y);
--> z=X.^2-Y.^2;
--> clf();f=scf(0);
--> surf(X,Y,Z);
Undefined variable: Z
--> x=linspace(0,5,10);y=x;
--> [X,Y]=meshgrid(x,y);
--> Z=X.^2-Y.^2;
--> clf();f=scf(0);
--> surf(X,Y,Z);
--> f.colour_map=hsvcolormap(32)
--> surf(X,Y,Z);
-->
-->
-->
-->
-->
--> Unknown property: colour_map.
Unknown property: colour_map.
^^
Error: syntax error, unexpected :, expecting end of file
--> x=linspace(0,5,10);y=x;
-->
--> [X,Y]=meshgrid(x,y);
--> Z=X.^2-Y.^2;
--> clf();f=scf(0);
--> clf();f=scf(0);
--> f.colour_map=hsvcolormap(32);
--> x=linspace(0,5,10);y=x;
--> [X,Y]=meshgrid(x,y);
--> Z=X.^2-Y.^2;
--> clf();f=scf(0);
--> f.colour_map=hsvcolormap(32);
--> x=linspace(0,5,10);y=x;
--> [X,Y]=meshgrid(x,y);
--> Z=X.^2-Y.^2;
--> clf();f=scf(0);
--> f.color_map=hsvcolormap(32);
--> x=linspace(0,5,10);y=x;
-->
-->
-->
-->
--> x=linspace(0,5,10);y=x;
-->
-->
-->
--> x=linspace(0,5,10);y=x;
-->
-->
-->
-->
--> x=linspace(0,5,10);y=x;
-->
-->
-->
-->
--> x=linspace(0,5,10);y=x;
-->
-->
-->
-->
--> x=linspace(0,5,10);y=x;
-->
-->
-->
-->
--> x=linspace(0,5,10);y=x;
-->
-->
-->
-->
--> x=linspace(0,5,10);y=x;
-->
-->
-->
--> x=linspace(0,5,10);y=x;
--> [x,y]=meshgrid(x,y);
--> z=x.^2-y.^2;
--> clf();f=scf(0);
--> f.color_map=hsvcolormap(32);