How to suppress output of function when calling from another function?
Mostra commenti meno recenti
So I have EulerMethod which when called itself I want it print the table with x = and y =. But when I call EulerMethod from LeapfrogMethod I don't want the one line of x = and y= to be outputted - is there a way to do this? (not semi-colon)
EulerMethod.m
function [ matrix ] = EulerMethod( fun, initX, initY,...
steplength, maximum )
...
fprintf('x = %3g, y = %3g\n',matrix(J,1),matrix(J,2))
...
end
LeapfrogMethod.m
function [ matrix ] = LeapfrogMethod( fun, initX, initY,...
steplength, maximum )
...
euler = EulerMethod(f,x0,y0,h,h);
...
end
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Functions for Programming and Data Types in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!