[Scilab-users] Array of struct

amiege arnaud.miege at gmail.com
Fri Mar 1 10:47:59 CET 2013


Samuel GOUGEON wrote
> It looks to works as expected. It is hard to help you without 
> knowning more about the structure that you use. Could you post 
> some lines of code that fail and that could be copied/pasted
> for test?
> 
> Samuel

Thank you all for your answers and suggestions. I can't give away all of the
code but the following should be enough to replicate the issue:



You will see that it only takes the first element of temp in pts as opposed
to the whole of the struct. In practice the size of temp will vary depending
on the file being read, but each element will always have the same fields
(partnumber, P and C), and the size of the matrices P and C doesn't change
either. The size of pts will depend on the number of files in the directory
being read (these operations are done in a loop, going through each file in
a directory). 

Maybe "pts($+1) = temp" is not the correct way to append the whole of the
struct in an existing struct, but I haven't found a way to do this so far.

Update: just realised that "pts($+1,:) = temp". Is that the correct way to
do it?

Thanks,

Arnaud



--
View this message in context: http://mailinglists.scilab.org/Array-of-struct-tp4026086p4026096.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list