Professional Documents
Culture Documents
25april PDF
25april PDF
y =
@(x)x^2-1
>> trap(y,0,5,5)
Undefined function or variable 'trap'.
>> trap(y,0,5,5)
Undefined function or variable 'trap'.
ans =
37.5000
>> trap
Error using trap (line 12)
at least 3 input arguments required
ans =
37.5000
ans =
36.6687
>> romberg
Error: File: romberg.m Line: 16 Column: 36
Unexpected MATLAB expression.
4/25/18 11:06 AM MATLAB Command Window 2 of 3
>> romberg
Error: File: romberg.m Line: 16 Column: 36
Unexpected MATLAB expression.
>> romberg(y,0.5,0.00001,5)
Error: File: romberg.m Line: 16 Column: 36
Unexpected MATLAB expression.
>> romberg
Error: File: romberg.m Line: 16 Column: 36
Unexpected MATLAB expression.
>> romberg
Error: File: romberg.m Line: 16 Column: 36
Unexpected MATLAB expression.
>> romberg
Error using romberg (line 15)
at least 3 input arguments required
>> romberg
Error using romberg (line 15)
at least 3 input arguments required
>> romberg
Error using romberg (line 15)
at least 3 input arguments required
>> romberg
Error using romberg (line 15)
at least 3 input arguments required
>> romberg(y,0,5,0.00001,5)
ans =
36.6667
>> trap
Error using trap (line 12)
at least 3 input arguments required
>> @(x)1-exp(-x)
ans =
@(x)1-exp(-x)
4/25/18 11:06 AM MATLAB Command Window 3 of 3
ans =
17.7600
>> y = @(x)1-exp(-x)
y =
@(x)1-exp(-x)
ans =
2.9665
ans =
2.966509232940782
ans =
2.966509232940782
ans =
2.966509232940782
ans =
4.006737926306090
>>