Re: convert value into variables
- From: Andrew <astevens@xxxxxxxxxxxx>
- Date: Tue, 24 Apr 2007 13:52:16 -0400
dave wrote:
andy wrote:
hello,
I have got a problem with converting value into variables.
I have a few data sets, one of the data set i've got are shown
below(the column number of a,b,c,d may varies):
a1 b c2 d
1 4 5 6
2 5 6 6
2 3 4 5
I would like to split the data so that
a1=[1;2;2],b=[4;5;3],c2=[5;6;4],d=[6;6;5]
help assignin
or
help eval
how can i do that?
Any ideas, please help, thanks!
Try this:
data={ 'a1' 'b' 'c2' 'd'
1 4 5 6
2 5 6 6
2 3 4 5};
[m,n]=size(data);
for i=1:n
assignin('base',char(data(1,i)),[data{2:end,i}]')
end
-Andrew
.
- References:
- convert value into variables
- From: andy
- Re: convert value into variables
- From: dave
- convert value into variables
- Prev by Date: Re: 32-bit Matlab on 10GB RAM System
- Next by Date: Automatically creating datatipcursor / datatipmarker
- Previous by thread: Re: convert value into variables
- Next by thread: image transform
- Index(es):
Relevant Pages
|