program that calls itself
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
How do I write a function file that calls itself without getting stuck in an infinite loop? I just want the program to call itself once.
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 20 Feb. 2012
Very simple example:
function x = foo(a,b)
if ~exist('b','var'); x = foo(a,0); return; end
x = a + b;
end
0 Kommentare
Siehe auch
Kategorien
Mehr zu Adding custom doc 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!