Reputation: 7
I am trying to create a matlab function which can accept any .m file and output tests run on it for example tic toc.
Basically I'd like something along the lines of:
function [time] = func (program.m)
tic program.m(); time = toc;
Any help would be greatly appreciated.
Upvotes: 1
Views: 220
Reputation: 24127
Take a look at the XUnit test framework for MATLAB, it does this and more: http://www.mathworks.co.uk/matlabcentral/fileexchange/22846-matlab-xunit-test-framework
Upvotes: 1