I have a function which should return two outputs, but if a condition is satisfied (in my case if a matrix is singular) it is no posible to calculate any output but the function returns the outputs. I would like to know if there is any posibility in order to return no output. This is my function:
function [x, NumIter] = Newton(fun, Jfun, x0, tol, IterMax) x = x0; NumIter = 0; funx = fun(x); Jfunx = Jfun(x); if rank(Jfunx)<length(Jfunx) disp('The matrix is singular') return end ...end
In this case, if the matrix is singular, the function returns the initial x and the initial number of iterations. Would be possible not to return them?
THANK YOU SO MUCH !!
Best Answer