I have got a long function, which downloads financial data from bloombberg, aggregates, cleans it etc. Now I will have to unit test it. Do I have to create a new function for each main section of the function and then test unit them separetely or does Matlab provide a faster/more elegant method of unit test long functions? Let's show you an example. Let's imagine I have to unit test this function:
if ~isa(a,'numeric') || ~isa(b,'numeric') || ~isa(c,'numeric')
'Coefficients must be...numeric.');
How to test it in pieces. First the if... part and second the root(x) part. Thank you in advance for your answers.