adding functions in a m file instead in the command line
Ältere Kommentare anzeigen
function x=mynewton (f,f1 ,x ,n)
x=0.1; % initial guess x0
n=100;
for i = 1:n
x = x - f(x) / f1(x); % Newton 's formula
end
x
Sir, I would like to declare these (f & f1) inside m file; pl. help
f = @(x) x^3 - 5
f1 = @(x) 3*x^2
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu MATLAB Compiler SDK finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!