[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Looping deeper in structure elements
From: |
Etienne Grossmann |
Subject: |
Re: Looping deeper in structure elements |
Date: |
Thu, 23 Nov 2006 00:25:23 -0500 |
User-agent: |
Mutt/1.4.2.1i |
Hi Falk,
something like this?
Code:=================================================================
zeug.cm0.x=4;
for [v,k] = zeug
for [v2,k2] = v
zeug.(k).(k2) *= 10;
end;
end;
zeug
Result:===============================================================
zeug =
{
cm0 =
{
x = 40
}
}
======================================================================
Note the zeug.(k) construct and the *= operator.
Hth,
Etienne
On Wed, Nov 22, 2006 at 09:03:09AM +0100, Falk Dechent wrote:
# Hi everybody!
# I'm new using octave (and never used mathlab) and I have several questions.
# Will slpit them in two posts.
#
# zeug.cm0=1;
#
# for [val,key] = zeug
# key=10 * val;
# endfor
# zeug.cm0 #result =1
#
#
# for [val,key] = zeug
# val=10 * val;
# endfor
# zeug.cm0 #result =1
#
#
# for [val,key] = zeug
# eval(strcat('zeug.' , key , '=10 *val;' ));
# endfor
# zeug.cm0 #result =10
#
# Well is there an other method do this my goal is something like this:
# zeug.cm0.x=4;
#
# for [val,key] = zeug
# for [val,key] = val
# val=10 * val;
# endfor
# endfor
# zeug.cm0.x=40;
#
# Ideas I hope someone can help
# Falk
#
# (octave 2.9.9)
# _______________________________________________
# Help-octave mailing list
# address@hidden
# https://www.cae.wisc.edu/mailman/listinfo/help-octave
--
Etienne Grossmann ------ http://www.isr.ist.utl.pt/~etienne
- Re: How many plotting engines do we have?, (continued)
- Re: How many plotting engines do we have?, P.J.G. Long, 2006/11/22
- Re: How many plotting engines do we have?, Joe Koski, 2006/11/23
- Re: How many plotting engines do we have?, David Bateman, 2006/11/23
- Re: How many plotting engines do we have?, P.J.G. Long, 2006/11/26
- Re: How many plotting engines do we have?, David Bateman, 2006/11/26
- Re: How many plotting engines do we have?, Francesco Potorti`, 2006/11/27
- Re: How many plotting engines do we have?, David Bateman, 2006/11/27
- Message not available
- Re: How many plotting engines do we have?, Jordi Gutierrez Hermoso, 2006/11/23
- Re: How many plotting engines do we have?, John W. Eaton, 2006/11/23
Looping deeper in structure elements, Falk Dechent, 2006/11/22
- Re: Looping deeper in structure elements,
Etienne Grossmann <=
Re: How many plotting engines do we have?, Falk Dechent, 2006/11/22