how to fix this
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
iko123
am 12 Feb. 2024
Kommentiert: iko123
am 13 Feb. 2024
% Function to perform Regula-Falsi method
function root = regula_falsi(f, a, b,tol)
fa = f(a);
fb = f(b);
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 12 Feb. 2024
You're not returning anything even though you said you would. In other words, you're not assigning "root" even though you are trying to return it. Try
% Function to perform Regula-Falsi method
% f is a vector and a and b are indexes to that vector.
% tol is passed in but not used for some reason.
function [fa, fb] = regula_falsi(f, a, b, tol)
fa = f(a);
fb = f(b);
3 Kommentare
Image Analyst
am 13 Feb. 2024
If this Answer solves your original question, then could you please click the "Accept this answer" link to award the answerer with "reputation points" for their efforts in helping you? They'd appreciate it. Thanks in advance. 🙂 Note: you can only accept one answer (so pick the best one) but you can click the "Vote" icon for as many Answers as you want. Voting for an answer will also award reputation points.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!