help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I read a variable name file?


From: Rubén Roa-Ureta
Subject: How do I read a variable name file?
Date: Thu, 31 Jul 2008 21:07:22 -0400
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

Hi:

I want to read text files that contain a single number but whose names changes according to user input, as in:

>Yr=input('Year :');
Yr: 1990
>filename=['SEPM_',num2str(Yr),'s2.txt']
filename = SEPM_1990s2.txt
>eval(eggstart=['load ',filename])

However, the single number in SEPM_1990s2.txt hasn't been assigned to eggstart

>eggstart
eggstart = load SEPM_1990s2.txt

whereas if I directly do the loading

>eggstart = load SEPM_1990s2.txt
eggstart =  the  single number in SEPM_1990s2.txt

the number is assigned.

What else should I do with the eval function to actually complete the assignment?

Thanks

Rubén



reply via email to

[Prev in Thread] Current Thread [Next in Thread]