
45Proling MATLAB
®
Performance
That is, instead of doing this:
>> profile on; for idx = 1:100, a = a-b + c^d*log(e); end; profile report
do this:
>> profile on; myFunc(a,b,c,d,e); profile report
Where myFunc.m is a le that contains the proled MATLAB code within a function:
function a = myFunc(a,b,c,d,e)
for idx = 1 : 100
a = a-b + c^d*log(e);
end
end
2.1.6.3 Ensuring Compatibility with Real-World Conditions
A second type of proling, no less useful, is to test a wide variety of scenarios, each with
repeatable data/actions, rather than repeatedly proling the same scenario. The reason
for this is to ensure the validity of the discov