rhodesR
rhodesR

Reputation: 7

Matlab - using a .m file as an input to a function

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

Answers (1)

Sam Roberts
Sam Roberts

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

Related Questions