[Scilab-users] How to assign column data to mlist?

Samuel Gougeon sgougeon at free.fr
Sun Jul 12 10:50:06 CEST 2015


Le 12/07/2015 06:21, jaipur a écrit :
> Thanks for your suggestion.
>
> Each element of data1 and data2 has, for example, individual's property like
> his height and weight. So, I want to treat as one element of mlist like
> MyMlist(3), MyMlist(3).field1, MyMlist(3).field2 when notice as individual.
>
> On the other hand, when I want to calculate mean value etc. of property, I'd
> like to treat as MyMlist.field1, MyMlist.field2(3:6) and so on.
>
> I understand overloading is the right way concerning mlist.
> But, is there simple way to create one structure without overloading
> fulfilling my wish above, when  I have each property data, data1 and data2?
You may use a structures array instead, together with list2vec(..) after 
extraction of values of any scalar field.
As well, do not hesitate to comment this thread 
http://bugzilla.scilab.org/11888, that claims for your request.
Presently, it is not possible to do element-wise assignment on 
structures array. Free overloadable operators
can't work with operands passed by reference, so can't be used for 
overloading some new types of assignment.

Regards
Samuel




More information about the users mailing list