[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
copying cs-lists with deviating fields
From: |
JokerOne |
Subject: |
copying cs-lists with deviating fields |
Date: |
Fri, 28 Aug 2015 09:17:57 -0700 (PDT) |
Hello everyone,
once again I am struggling with cs-lists, and indexed cs-lists, as I hope
the following structures are called corrctly.
What I would like to ask is:
Imagine we have:
a(1).a = 1;
a(1).b = 2;
a(1).c = 3;
and
b.b = 4;
b.c = 5;
b.d = 6;
I like to have an easy way to integrate the fields 'b' and 'c' of variable
'b' to a ?
e.g.:
a(1) = b; %??? does not work
This does not work.
One could of course:
a(1).b = b.b; % works but cumbersome for larger cs-lists
a(1).c = b.c; % ....
but this requires exact knowlege of the filednames of a and b and gets
cumbersome if the cs-lists become larger (a.e,a.f, a.g, ...)
Is there anything like:
a(1) = set_only_these_fields_that_suit_to_the_structure(b) %?
Maybe "setfields", but as far as I see, setfields does not fit my needs. I
potentially could make the desired function on my own (by looping over both
structures and check if the fieldnames agree), but I would like to ask first
if there is anything already available.
I am using Octave 4.0.0 if this matters?
Thanks for any help.
--
View this message in context:
http://octave.1599824.n4.nabble.com/copying-cs-lists-with-deviating-fields-tp4672345.html
Sent from the Octave - General mailing list archive at Nabble.com.
- copying cs-lists with deviating fields,
JokerOne <=