Prev: plot3 : colour proportional to height?
Next: assempde
From: Jean-Philip Dumont on 16 Jul 2010 10:21 Hi, I'm importing a time series into MATLAB. I have over 20 columns. I'm using xlsread and here is the code : [Data Titles] = xlsread('Name of file', 'Sheet', 'Range') After that, I would like to separate all the different variables and give them a different name. I know I can access the 'Data' matrice to get whatever colum I need but there is no relation between the variables so I will have to remember the colum of each variable. Basically, instead of doing : Variable1 = Data(:,1); Variable2 = Data(:,2); and so on for over 20 times. But all the names are different so i can't make a loop and modify the name in the loop. Is there a way do to this automatically...or in a loop? Is there a way to use the Titles I imported to identify each of my variable separatly? Thank you very much! JP
From: Steven Lord on 16 Jul 2010 10:45 "Jean-Philip Dumont" <jean-philip.dumont(a)hec.ca> wrote in message news:i1ppsi$elt$1(a)fred.mathworks.com... > Hi, > > I'm importing a time series into MATLAB. I have over 20 columns. > > I'm using xlsread and here is the code : > > [Data Titles] = xlsread('Name of file', 'Sheet', 'Range') > > After that, I would like to separate all the different variables and give > them a different name. I know I can access the 'Data' matrice to get > whatever colum I need but there is no relation between the variables so I > will have to remember the colum of each variable. > > Basically, instead of doing : > Variable1 = Data(:,1); > Variable2 = Data(:,2); > and so on for over 20 times. But all the names are different so i can't > make a loop and modify the name in the loop. Is there a way do to this > automatically...or in a loop? Yes, but you should not do so. See Q4.6 in the newsgroup FAQ for an explanation. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: Jean-Philip Dumont on 16 Jul 2010 11:07 "Steven Lord" <slord(a)mathworks.com> wrote in message <i1prau$hv3$1(a)fred.mathworks.com>... > > "Jean-Philip Dumont" <jean-philip.dumont(a)hec.ca> wrote in message > news:i1ppsi$elt$1(a)fred.mathworks.com... > > Hi, > > > > I'm importing a time series into MATLAB. I have over 20 columns. > > > > I'm using xlsread and here is the code : > > > > [Data Titles] = xlsread('Name of file', 'Sheet', 'Range') > > > > After that, I would like to separate all the different variables and give > > them a different name. I know I can access the 'Data' matrice to get > > whatever colum I need but there is no relation between the variables so I > > will have to remember the colum of each variable. > > > > Basically, instead of doing : > > Variable1 = Data(:,1); > > Variable2 = Data(:,2); > > and so on for over 20 times. But all the names are different so i can't > > make a loop and modify the name in the loop. Is there a way do to this > > automatically...or in a loop? > > Yes, but you should not do so. See Q4.6 in the newsgroup FAQ for an > explanation. > > -- > Steve Lord > slord(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ > To contact Technical Support use the Contact Us link on > http://www.mathworks.com > I see! Thank you!
|
Pages: 1 Prev: plot3 : colour proportional to height? Next: assempde |