using variable arguments with "load"

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

using variable arguments with "load"

Tom Short
Is there any way to pass arguments to the builtin "load" command such as:

octave:1> a = "test.dat";
octave:2> load a

This statement tries to load a file called "a". Is there a way to get octave
to load the file which has its name stored in the variable ("test.dat")?

- Tom
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: using variable arguments with "load"

Tom Short
>Is there any way to pass arguments to the builtin "load" command such as:
>
>octave:1> a = "test.dat";
>octave:2> load a
>
>This statement tries to load a file called "a". Is there a way to get octave to
>load the file which has its name stored in the variable ("test.dat")?

Found an answer by looking at a file which Eyal Doron did:

octave:1> eval(["load ",a]);