Sei sulla pagina 1di 8

function c = Lat02(fnc,a,b,tol)

function c = Lat02(fnc,a,b,tol)
|
{#Error: Function definitions are not permitted in this context.
}#
function y = Lat01(x);
function y = Lat01(x);
|
{#Error: Function definitions are not permitted in this
context.
}#
f(x) = 0;
{#Undefined function or variable 'x'.
}#
syms a b c x
FUNCTION y = Lat01(x);
{#Cannot find an exact (case-sensitive) match for 'FUNCTION'

The closest match is: function in C:\Program


Files\MATLAB\R2013a\toolbox\matlab\lang\function.m

}#
syms a b c x
FUNCTION y = Lat01(x);
{#Cannot find an exact (case-sensitive) match for 'FUNCTION'

The closest match is: function in C:\Program


Files\MATLAB\R2013a\toolbox\matlab\lang\function.m

}#
function y = Lat01(x);function y = Lat01(x);
function y = Lat01(x);function y = Lat01(x);
|
{#Error: Function definitions are not permitted in this
context.
}#
function y = Lat01(x);
function y = Lat01(x);
|
{#Error: Function definitions are not permitted in this
context.
}#
syms a b c x
function y = Lat01(x);
function y = Lat01(x);
|
{#Error: Function definitions are not permitted in this
context.
}#
syms a b c x
function y = Lat01(x);
function y = Lat01(x);
|
{#Error: Function definitions are not permitted in this
context.
}#
Lat01
{#Error: <a href="matlab: opentoline('D:\SEMESTER 5\KOMPUTASI
FISIKA\MATLAB\Lat01.m',22,20)">File: Lat01.m Line: 22 Column: 20
</a>The expression to the left of the equals sign is not a valid target for an
assignment.
}#
function y = Lat01(fny,x);
function y = Lat01(fny,x);
|
{#Error: Function definitions are not permitted in this context.
}#

function c = Lat02(fnc,a,b,tol)
function c = Lat02(fnc,a,b,tol)
|
{#Error: Function definitions are not permitted in this context.
}#
syms a b c d x
f(x) = 0;
{#Error using <a href="matlab:helpUtils.errorDocCallback('sym/subsindex',
'C:\Program Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m', 1558)"
style="font-weight:bold">sym/subsindex</a> (<a href="matlab: opentoline('C:\Program
Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m',1558,0)">line 1558</a>)
Indexing input must be numeric, logical or ':'.
}#
syms a b c d x s
f(x) = 0;
{#Error using <a href="matlab:helpUtils.errorDocCallback('sym/subsindex',
'C:\Program Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m', 1558)"
style="font-weight:bold">sym/subsindex</a> (<a href="matlab: opentoline('C:\Program
Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m',1558,0)">line 1558</a>)
Indexing input must be numeric, logical or ':'.
}#
syms x
f(x) = 0;
{#Error using <a href="matlab:helpUtils.errorDocCallback('sym/subsindex',
'C:\Program Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m', 1558)"
style="font-weight:bold">sym/subsindex</a> (<a href="matlab: opentoline('C:\Program
Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m',1558,0)">line 1558</a>)
Indexing input must be numeric, logical or ':'.
}#
syms x
f(x) = 0;
{#Error using <a href="matlab:helpUtils.errorDocCallback('sym/subsindex',
'C:\Program Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m', 1558)"
style="font-weight:bold">sym/subsindex</a> (<a href="matlab: opentoline('C:\Program
Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m',1558,0)">line 1558</a>)
Indexing input must be numeric, logical or ':'.
}#
syms a b x
f(x) = 0;
{#Error using <a href="matlab:helpUtils.errorDocCallback('sym/subsindex',
'C:\Program Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m', 1558)"
style="font-weight:bold">sym/subsindex</a> (<a href="matlab: opentoline('C:\Program
Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m',1558,0)">line 1558</a>)
Indexing input must be numeric, logical or ':'.
}#
helpUtils.errorDocCallback('sym/subsindex', 'C:\Program
Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m', 1558)
sym a b x
{#Error using <a href="matlab:helpUtils.errorDocCallback('sym')" style="font-
weight:bold">sym</a>
Too many input arguments.
}#
var = sym (a b x)
var = sym (a b x)
|
{#Error: Unexpected MATLAB expression.
}#
f(x) = 0;
{#Error using <a href="matlab:helpUtils.errorDocCallback('sym/subsindex',
'C:\Program Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m', 1558)"
style="font-weight:bold">sym/subsindex</a> (<a href="matlab: opentoline('C:\Program
Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m',1558,0)">line 1558</a>)
Indexing input must be numeric, logical or ':'.
}#
f(x) = 0;
{#Error using <a href="matlab:helpUtils.errorDocCallback('sym/subsindex',
'C:\Program Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m', 1558)"
style="font-weight:bold">sym/subsindex</a> (<a href="matlab: opentoline('C:\Program
Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m',1558,0)">line 1558</a>)
Indexing input must be numeric, logical or ':'.
}#
helpUtils.errorDocCallback('sym/subsindex', 'C:\Program
Files\MATLAB\R2013a\toolbox\symbolic\symbolic\@sym\sym.m', 1558)
Lat01
{#Error: <a href="matlab: opentoline('D:\SEMESTER 5\KOMPUTASI
FISIKA\MATLAB\Lat01.m',2,1)">File: Lat01.m Line: 2 Column: 1
</a>Function definitions are not permitted in this context.
}#
function y = Lat01 (x)
function y = Lat01 (x)
|
{#Error: Function definitions are not permitted in this
context.
}#
Lat01
function c = Lat02 (fnc, a, b, tol)
function c = Lat02 (fnc, a, b, tol)
|
{#Error: Function definitions are not permitted in this
context.
}#
function c = Lat02 (fnc, a, b, tol)
function c = Lat02 (fnc, a, b, tol)
|
{#Error: Function definitions are not permitted in this
context.
}#
%% Program Metode Penyelesaian persamaan nonlinier - Metode bagi dua / Biseksi
%
% Program Metode bagi dua ini dimodifikasi oleh MZA math.Lectures Youtube Channel
%
%
% Input
% fungsi non linier yang didefinisikan dalam mfile f.m
% batas atas dan batas bawah
% galat toleransi
%
% Output
% iterasi, solusi dan galat
%

clear
clc
disp(' Metode Bagi dua')
Metode Bagi dua
disp('Tekan Enter untuk lanjut')
Tekan Enter untuk lanjut
pause
clc
f=input('Fungsi f:');
Fungsi f:%% Program Metode Penyelesaian persamaan nonlinier - Metode bagi dua /
Biseksi
{#Error: Expression or statement is incomplete or incorrect.
}#
Fungsi f:%
{#Error: Expression or statement is incomplete or incorrect.
}#
Fungsi f:% Program Metode bagi dua ini dimodifikasi oleh MZA math.Lectures Youtube
Channel
{#Error: Expression or statement is incomplete or incorrect.
}#
Fungsi f:%
{#Error: Expression or statement is incomplete or incorrect.
}#
Fungsi f:%
{#Error: Expression or statement is incomplete or incorrect.
}#
Fungsi f:% Input
{#Error: Expression or statement is incomplete or incorrect.
}#
Fungsi f:% fungsi non linier yang didefinisikan dalam mfile f.m
{#Error: Expression or statement is incomplete or incorrect.
}#
Fungsi f:% batas atas dan batas bawah
{#Error: Expression or statement is incomplete or incorrect.
}#
Fungsi f:% galat toleransi
{#Error: Expression or statement is incomplete or incorrect.
}#
Fungsi f:%
{#Error: Expression or statement is incomplete or incorrect.
}#
Fungsi f:% Output
{#Error: Expression or statement is incomplete or incorrect.
}#
Fungsi f:% iterasi, solusi dan galat
{#Error: Expression or statement is incomplete or incorrect.
}#
Fungsi f:%
{#Error: Expression or statement is incomplete or incorrect.
}#
Fungsi f:disp(' Metode Bagi dua')
{#Error using <a href="matlab:helpUtils.errorDocCallback('disp')" style="font-
weight:bold">disp</a>
Too many output arguments.
}#
Fungsi f:disp('Tekan Enter untuk lanjut')
{#Error using <a href="matlab:helpUtils.errorDocCallback('disp')" style="font-
weight:bold">disp</a>
Too many output arguments.
}#
Fungsi f:pause
a=input('Masukkan batas bawah :');
Masukkan batas bawah :f=input('Fungsi f:');
{#Error: The expression to the left of the equals sign is not
a valid target for an assignment.
}#
Masukkan batas bawah :a=input('Masukkan batas bawah :');
{#Error: The expression to the left of the equals sign is not
a valid target for an assignment.
}#
Masukkan batas bawah :b=input('Masukkan batas atas :');
{#Error: The expression to the left of the equals sign is not
a valid target for an assignment.
}#
Masukkan batas bawah :galat1=input('Masukkan galat Toleransi :');
{#Error: The expression to the left of the equals sign is not
a valid target for an assignment.
}#
Masukkan batas bawah :ya=feval(f,a) ; %Nilai f(a)
{#Error: The expression to the left of the equals sign is not
a valid target for an assignment.
}#
Masukkan batas bawah :yb=feval(f,b); %Nilai f(b)
{#Error: The expression to the left of the equals sign is not
a valid target for an assignment.
}#
Masukkan batas bawah :iter=0;
{#Error: The expression to the left of the equals sign is not
a valid target for an assignment.
}#
Masukkan batas bawah :c1=a;
{#Error: The expression to the left of the equals sign is not
a valid target for an assignment.
}#
Masukkan batas bawah :galat=abs((b-a)/b);
{#Error: The expression to the left of the equals sign is not
a valid target for an assignment.
}#
Masukkan batas bawah :
b=input('Masukkan batas atas :');
Masukkan batas atas :while ya*yb>0
disp('Ingat f(a)*f(b)>0, berarti tidak ada akar dalam selang'),
break,
end
{#Error: Illegal use of reserved keyword "while".
}#
Masukkan batas atas :
galat1=input('Masukkan galat Toleransi :');
Masukkan galat Toleransi :fprintf('\n iterasi a b c
f(c) Galat\n');

iterasi a b c f(c) Galat


ya=feval(f,a) ; %Nilai f(a)
{#Error using <a href="matlab:helpUtils.errorDocCallback('feval')" style="font-
weight:bold">feval</a>
Undefined function 'on' for input arguments of type
'double'.
}#
while galat>galat1
iter=iter+1;
c=(a+b)/2;
yc=feval(f,c);
a1=a;b1=b; % Inisialisasi untuk Tampilan
while c==0, break,
end
if ya*yc<0
b=c;
yb=yc;
else
a=c;
ya=yc;
end
galat=abs((c-c1)/c);
c1=c;

fprintf('%10.0f %6.10f %6.10f %6.10f %6.10f %6.10f\n',[iter;a1;b1;c


;yc;galat])
end
{#Undefined function or variable 'galat'.
}#
f=input('Fungsi f:');
Fungsi f:
a=input('Masukkan batas bawah :');
Masukkan batas bawah :
b=input('Masukkan batas atas :');
Masukkan batas atas :
galat1=input('Masukkan galat Toleransi :');
Masukkan galat Toleransi :
ya=feval(f,a) ; %Nilai f(a)
{#Error using <a href="matlab:helpUtils.errorDocCallback('feval')" style="font-
weight:bold">feval</a>
Argument must contain a string or function_handle.
}#

helpUtils.errorDocCallback('feval')
%% Program Metode Penyelesaian persamaan nonlinier - Metode bagi dua / Biseksi
%
% Program Metode bagi dua ini dimodifikasi oleh MZA math.Lectures Youtube Channel
%
%
% Input
% fungsi non linier yang didefinisikan dalam mfile f.m
% batas atas dan batas bawah
% galat toleransi
%
% Output
% iterasi, solusi dan galat
%

clear
clc
disp(' Metode Bagi dua')
Metode Bagi dua
disp('Tekan Enter untuk lanjut')
Tekan Enter untuk lanjut
pause
clc
f=input('Fungsi f:');
Fungsi f:
a=input('Masukkan batas bawah :');
Masukkan batas bawah :
b=input('Masukkan batas atas :');
Masukkan batas atas :
galat1=input('Masukkan galat Toleransi :');
Masukkan galat Toleransi :
ya=feval(f,a) ; %Nilai f(a)
{#Error using <a href="matlab:helpUtils.errorDocCallback('feval')" style="font-
weight:bold">feval</a>
Argument must contain a string or function_handle.
}#

%% Program Metode Penyelesaian persamaan nonlinier - Metode bagi dua / Biseksi


%
% Program Metode bagi dua ini dimodifikasi oleh MZA math.Lectures Youtube Channel
%
%
% Input
% fungsi non linier yang didefinisikan dalam mfile f.m
% batas atas dan batas bawah
% galat toleransi
%
% Output
% iterasi, solusi dan galat
%

clear
clc
disp(' Metode Bagi dua')
Metode Bagi dua
disp('Tekan Enter untuk lanjut')
Tekan Enter untuk lanjut
pause
clc
f=input('Fungsi f:');
Fungsi f:
a=input('Masukkan batas bawah :');
Masukkan batas bawah :0
b=input('Masukkan batas atas :');
Masukkan batas atas :-5
galat1=input('Masukkan galat Toleransi :');
Masukkan galat Toleransi :8
ya=feval(f,a) ; %Nilai f(a)
{#Error using <a href="matlab:helpUtils.errorDocCallback('feval')" style="font-
weight:bold">feval</a>
Argument must contain a string or function_handle.
}#
8

ans =

Potrebbero piacerti anche