Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



String Assignment Question
Posted:
Jul 15, 1996 11:22 AM


Hi folks:
I'm having trouble assigning variable names to data sets in Mfiles. I currently have an Mfile which prompts for data vectors DATA1, DATA2... from a very large matrix and does some processing on them, including sorting them according to various conditions COND1, COND2...
I would like the function to return variables 'dataxcondy' where datax refers to the userspecified data vector (which actually have names like 'TIME', 'TEMP1'...there are 100+ more) and condy refers to the condition matrix: in Matlab speak,
data3cond1 = COND1(:,3); data1cond4 = COND4(:,1); etc
Now the problem. I would like the variable name to use the lowercase version of the name of the data vector. So if my file asks
> dname1 = input('Data channel 1: ','s')
and I respond
TIME
I would like to get back the variables 'timecond1', 'timecond2'... without hardcoding the variable names in my function (or script, if that would be easier) Essentially, I want the functional equivalent of
[lower(dnamex) 'condy'] = CONDY(:,X); (This construction returns the error message: Missing operator, comma, or semicolon.)
Anyone know how to do this?
TIA,
Dave Tan tan@essc.psu.edu



