The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: String Assignment Question
Replies: 2   Last Post: Jul 16, 1996 5:54 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
David Tan

Posts: 20
Registered: 12/7/04
String Assignment Question
Posted: Jul 15, 1996 11:22 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi folks:

I'm having trouble assigning variable names to data sets
in M-files. I currently have an M-file 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 user-specified data vector (which
actually have names like 'TIME', 'TEMP1'...there are 100+
more) and condy refers to the condition matrix: in Matlab

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


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 semi-colon.)

Anyone know how to do this?


Dave Tan

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.