From: Sinisa Jelicic on 17 Feb 2010 17:19 I have 1X10 struct: <4600x1 double><4600x1 double><4600x1 cell><4600x1 cell><4600x1 double><4600x1 double><4600x1 double><4600x1 cell><4600x1 cell><4600x1 cell> first line on data is 1;1;Sanja;Jelicic;601;80270;133;a13rii8t;False;02/07/2010 00:03:07; I need to get single matrix containing 10 columns I can do cell2mat for 1,2, 5, 6 and 7th column but char or str2num don't work for the rest help. how to extract this data into one column also data is same but I have 1X3 struct all this 3 columns have 1x10 structs with <4600x1 double><4600x1 double><4600x1 cell><4600x1 cell><4600x1 double><4600x1 double><4600x1 double><4600x1 cell><4600x1 cell><4600x1 cell> whot do make 3 matrices with just data from this 10 columns Thanks Sinisa
From: Nathan on 17 Feb 2010 17:24 On Feb 17, 2:19 pm, "Sinisa Jelicic" <tis...(a)gmail.com> wrote: > I have > 1X10 struct: > > <4600x1 double><4600x1 double><4600x1 cell><4600x1 cell><4600x1 double><4600x1 double><4600x1 double><4600x1 cell><4600x1 cell><4600x1 cell> > > first line on data is > 1;1;Sanja;Jelicic;601;80270;133;a13rii8t;False;02/07/2010 00:03:07; > > I need to get single matrix containing 10 columns > I can do cell2mat for 1,2, 5, 6 and 7th column but char or str2num don't work for the rest > > help. how to extract this data into one column > > also > > data is same > but I have 1X3 struct all this 3 columns have 1x10 structs with > <4600x1 double><4600x1 double><4600x1 cell><4600x1 cell><4600x1 double><4600x1 double><4600x1 double><4600x1 cell><4600x1 cell><4600x1 cell> > > whot do make 3 matrices with just data from this 10 columns > > Thanks > Sinisa You can't mix data types with a matrix. That's the whole point of using a cell array or struct in the first place, if possible. Try some manipulation with struct2cell Why do you need the info in a matrix? What are you going to do with this data? -Nathan
From: Sinisa Jelicic on 17 Feb 2010 17:42 > You can't mix data types with a matrix. That's the whole point of > using a cell array or struct in the first place, if possible. > > Try some manipulation with struct2cell > > Why do you need the info in a matrix? What are you going to do with > this data? > > > -Nathan Hi, ok then how to enter into a struct <1x3><1x10><4000x1> I want to use data that is at 1 column in <1x3> 3 column in <1x10> and 400 row in <4000x1>. How to do that ? Thanks Sinisa
From: Nathan on 17 Feb 2010 17:47 On Feb 17, 2:42 pm, "Sinisa Jelicic" <tis...(a)gmail.com> wrote: > > You can't mix data types with a matrix. That's the whole point of > > using a cell array or struct in the first place, if possible. > > > Try some manipulation with struct2cell > > > Why do you need the info in a matrix? What are you going to do with > > this data? > > > -Nathan > > Hi, ok > > then how to enter into a struct > <1x3><1x10><4000x1> > > I want to use data that is at 1 column in <1x3> 3 column in <1x10> and 400 row in <4000x1>. How to do that ? > > Thanks > Sinisa "<1x3><1x10><4000x1>" Doesn't mean anything specific to me. type whos VARIABLENAME where VARIABLENAME is the variable that contains your data. What is the variable type? You said it was a struct already, I thought. If that's the case, what is the point of the question "then how to enter into a struct"? Your data types are vague. Can you give me a small example of REAL data that represents what you want done? -Nathan
From: Sinisa Jelicic on 17 Feb 2010 17:56 Ok, this is program fileList = dir('C:\Users\Laptop\Desktop\Matlab\fileList\kds') fileList = fileList(~[fileList.isdir]); %remove directories [junk, sortorder] = sort([fileList.datenum]); fileList = fileList(sortorder); %list is now in ascending date order numfiles = numel(fileList); In = cell(1,numfiles); for ii = 1:numfiles fid = fopen(fileList(ii).name); In{ii} = textscan(fid, '%s', 'delimiter', ';'); fclose(fid); end it creates 1x3 struct in every 3 columns is struct 1x10 struct and in every of those 10 columsn is 4000x1 struct. first line of raw data was 1;1;Sanja;Jelicic;601;80270;133;a13rii8t;False;02/07/2010 00:03:07; and I want to know how to get 'Sanja' form this or how to get into 1 column, then in that coulum 3 rd column and in that column 1 row
|
Next
|
Last
Pages: 1 2 3 Prev: help-- fit complex data Next: How do I execute *.m file and *.mdl file simultaneously |