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: import data and name variables
Replies: 1   Last Post: Apr 17, 2009 4:49 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Andrea Asoni

Posts: 10
Registered: 4/15/09
import data and name variables
Posted: Apr 17, 2009 1:37 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


if i import data using the Import Wizard, I end up with three thing in my workspace: a matrix with the data (called data) and two strings of cells with the names of the variables I imported from .txt (colheaders and textdata).

now i can create variables in matlab saying for example var1=data(:,1) and so on.

is there a way however to do this using the information in colheaders and textdata?
something like "name the first variable using the name in the first cell of colheaders/textdata and assign to such variable the values in the first column of data"...


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.