Professional Documents
Culture Documents
Laporan Syntax Pemrograman MATLAB
Laporan Syntax Pemrograman MATLAB
PERCOBAAN 1
MENGENAL SINTAK SINTAK PEMROGRAMAN DI MATLAB
TUGAS 1
x = 4+2^3-sqrt(4^2-7)/(2^2-1)*4^2-1
y = 1+(3^2-4)^2/(sqrt(2^4+9)+5)*2^3
HASIL
>> prak1
x=
-5
y=
21
TUGAS 2
HASIL
>> prak2
***************************************************
This script file solves for the roots of the
quadratic equation of the form: ax^2+bx+c=0
***************************************************
*** Enter the coefficient a :2
*** Enter the coefficient b :2
*** Enter the coefficient d :2
***************************************************
The roots of the quadratic equation
of the form: ax^2+bx+c=0, are :
root1 =
-0.5000 + 0.8660i
root2 =
-0.5000 - 0.8660i
TUGAS 3
HASIL
>> prak2
***************************************************
This script file solves for the roots of the
quadratic equation of the form: ax^2+bx+c=0
***************************************************
*** Enter the coefficient a :2
*** Enter the coefficient b :3
*** Enter the coefficient d :7
***************************************************
The roots of the quadratic equation
of the form: ax^2+bx+c=0, are :
root1 =
-0.7500 + 1.7139i
root2 =
-0.7500 - 1.7139i
>> prak2
***************************************************
This script file solves for the roots of the
quadratic equation of the form: ax^2+bx+c=0
***************************************************
*** Enter the coefficient a :pi
*** Enter the coefficient b :2*pi
>> prak2
***************************************************
This script file solves for the roots of the
quadratic equation of the form: ax^2+bx+c=0
***************************************************
*** Enter the coefficient a :log10(32.3)
*** Enter the coefficient b :sqrt(3^3+1.33^3.3)
*** Enter the coefficient d :tan(1.112)
***************************************************
The roots of the quadratic equation
of the form: ax^2+bx+c=0, are :
root1 =
-0.4217
root2 =
-3.1810
***************************************************
TUGAS 4
HASIL
>> func_quad_sol(2,3,7)
***********************************************
This function file solves for the roots of the
quadratic equation of the form: ax^2+bx+c=0
given the coefficients a, b, and c as inputs
*************The roots are:*******************
root1 =
-0.7500 + 1.7139i
root2 =
-0.7500 - 1.7139i
***********************************************
ans =
-0.7500 + 1.7139i
>> func_quad_sol(pi,2*pi,3*pi)
***********************************************
This function file solves for the roots of the
quadratic equation of the form: ax^2+bx+c=0
given the coefficients a, b, and c as inputs
*************The roots are:*******************
root1 =
-1.0000 + 1.4142i
root2 =
-1.0000 - 1.4142i
***********************************************
ans =
-1.0000 + 1.4142i