"Mayowa Kassim Aregbesola" <mailmayowa@gmail.com> wrote in message <gknqc0$mu6$1@fred.mathworks.com>...
> Hi guys,
> I am trying to implement a code in matlab. I need to run a file based on the input i feed in
>
> for instance I want to run testfile2.m
>
> testcase = 2;
> testfile = ['testfile', num2str(testcase), '.m'];
>
> run testfile; %wish to run testfile2.m
>
>
> how can I implement this.
>
> thanks in advance

"Mayowa Kassim Aregbesola" <mailmayowa@gmail.com> wrote in message <gknqc0$mu6$1@fred.mathworks.com>...
> Hi guys,
> I am trying to implement a code in matlab. I need to run a file based on the input i feed in
>
> for instance I want to run testfile2.m
>
> testcase = 2;
> testfile = ['testfile', num2str(testcase), '.m'];
>
> run testfile; %wish to run testfile2.m
>
>
> how can I implement this.
>
> thanks in advance