In Matlab, I have a function:
function [ Result ] = Calc_Result(A, B, C, D)
How do I graph the output of this function, for values A=0.00 to A=1.00, in steps of 0.01? Variables B,C,D are constants.
If the function returns NaN at any point on the graph, I need some method handling this (Matlab shouldn’t fall over).
As strictlyrude27 said, if your function can deal with vectorisation, you can just use
If not, you can use
arrayfunto avoid a loop:plotdeals with NaNs gracefully by default (it doesn’t plot them and breaks the line it draws at every NaN).