[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Removing disadvantages on struct array and cell struct array?

From: veryhappy
Subject: Removing disadvantages on struct array and cell struct array?
Date: Sat, 8 Jan 2011 03:22:51 -0800 (PST)

I needed to describe some circuits so i made a struct with the fields i
wanted for each component (all the components have the same fields: type,
value and print_value) but when i want to put them in an array and assign it
to the circuit i'd found that i've two possibilities:
Making a cell struct array or making a struct array.
The first one has the advantage that when i ask for the content of the
variable it prints out full information in the form of name and contents of
each of the components (this is VERY interesting for me) but i think (I may
be wrong) i'll have a harder work to process them because i'll need to
create auxiliary functions and use cellfun for almost anything.
On the other side if i make it a struct array it will be easier to work with
it but it doesn't print the full contents instead all it does is to print
1xsize struct array containing the fields: type value print_value
Is there a way to overcome any of those disadvantages ,i.e make easier to
work with a cell struct array  (removing the need to use cellfun most of the
times) or make the struct array print the full contents instead of a briefly
description of which fields does it have?
I'm using version 3.2.4 on windows
View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]