Running a script that is stored witin a cell array

I have written an mfile that creates a user selectable list of other mfiles, the list is numbered and users input a number between 1 and whatever to select the mfile they want to open. The problem I have is that after the user selection has been made I cannot use the 'run' command to open the selected mfile as it is stored with a cell array. Say for example the user selects the first mfile in the list by entering '1', this means the file I want to open is stored in the firt row of the cell array eg (cell_array{1}) In my script at the moment as the last line I have;

run (char(cell_array{1}))

however this doesnt work as run will only accept a filname or command as an input.

I can use open(char(cell_array{1})) although this interupts the automation of the process im trying to create.

Does anyone have any ideas how I can do this? any help would be appreciated as to me it seems like a bit of a stupid problem to have.

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion