how can i assign values to variables?

Good Morning every one!! Today i have question too. i have one Matrix which Name is zeile and it includes 181 cell Array which are my 181 Parameters. In Addition i have one Matrix too.Its Name is dataArray and in this Matrix i have all values that belong to 181 Parameter.My question is how can i assign my values to These Parameters?

5 Comments

because i have 181 Parameters i want to assign values dynamically. Could you give me advice about this Problem?
You seem to be asking variations of the same question, always without much details.
In particular, it's really not clear what you want do with the data once we've shown you how to do whatever you're asking. It may well be that what you're asking is not what you need anyway.
Also, how did you get your two cell arrays in matlab, possibly there is a smarter way to load your data that gives you what you want straight away
It would also help if you used proper terminology. parameter has no meaning. You can assign values to variables.
In this particular case, it's unclear what output you want? A structure with field names that are the value from your first cell array and values that are the matrices from your second cell array? Individual variables named after the values from your first cell array (possible, but not a good idea)?
Finally, in your example, zeite has indeed 181 elements, but dataArray has 182.
first of all i got Experiment results as a text file which includes Parameters and values. First of all i read with textscan all my Parameters and than i created my Matrix zeile which includes 181 variables. after that i read values or results of Experiment which Name is dataArray .I checked it last column (182) is empty.Every column in dataArray must be send to variable in Matrix zeile.I mean for one variable one column

Sign in to comment.

 Accepted Answer

for it=1:181
zeile{it,1}=dataArray{1,it}
end

7 Comments

i took this massage from matlab Conversion to cell from double is not possible.
can u send the two matrix files
in third file you can see my structure variables too.
var= zeile{1,1}
for it=1:181
tmp = dataArray{1,it}
tmp1 =sprintf('%s',var{it,1})
eval([tmp1 ' = tmp']);
end
for j=1:181 s.(zeile{1,1}{j,1})=dataArray{1,j} end i made it this way and it works.thanx for your help!!!
As you see in attached file in Input_Map_1 there are 181 variables. i want to make calculation with them,But how can i call variables
. what is the correct code that i should write my m file??
Any help!!!! i used str2mat to get the values but it does not work because i have 41*1 Matrix and when used this code i get 41*13 Matrix.. do you have any advice to me?

Sign in to comment.

More Answers (0)

Categories

Asked:

on 28 Jan 2015

Edited:

on 28 Jan 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!