Professional Documents
Culture Documents
Matlab Funçao
Matlab Funçao
f = x^2;
>> myfun(2)
ans =
>> myfun(6)
ans =
36
>> x = fminbnd(@myfun,-1,1)
x=
-2.7756e-017
>> x = fminbnd(@myfun,-1,1)
x=
-2.7756e-017
>> x=-1:0.1:1
x=
Columns 1 through 7
Columns 8 through 14
Columns 15 through 21
>> y=x.2
??? y=x.2
>> y=x.^2
y=
Columns 1 through 7
Columns 15 through 21
>> plot(x,y)
>> hold on
>> x = fminbnd(@myfun,-1,1)
x=
-2.7756e-017
>> plot(x,myfun(x),'*r')
>>