[Scilab-users] tlist function

Serge Steer serge.steer at inria.fr
Wed Jan 9 21:00:33 CET 2013



----- Mail original -----
> De: "samy" <samad13 at hotmail.de>
> À: users at lists.scilab.org
> Envoyé: Mercredi 9 Janvier 2013 15:56:04
> Objet: [Scilab-users] tlist function
> 
> hi everybody,
> i build in vb.net application from a large xml file a tlist which
> contains
> all nodes from xml in form of tlist, because i work with scicoslab
> and this
> canot parse a xml file. now i have a problem i will make a function
> in
> scilab, when i get for example a output like this:
> BHCurve=tlist(['BHCurve';'Point';'Point';'Point';'Point';'']);
> BHCurve.Point=tlist(['Point';'B';'H'],0,0);
> BHCurve.Point=tlist(['Point';'B';'H'],0.05,32);
> BHCurve.Point=tlist(['Point';'B';'H'],0.1,55);
> i want to have all the points information without manipulating the
> point i
> try it in vb.net with numbers Point1,Point2 but this is not the very
> fine
> solution.
> thanks
> 
A tlist with several equal field names will not work as you expect: when you write BHCurve.Point=xxx there is no reason for Scilab to know it has to change the assigned field
is it possible for you to generate something like
BHCurve=tlist(['BHCurve';'Points'],mlist(["Points","B","H"],[],[]));
BHCurve.Points($+1)=[0 0]
BHCurve.Points($+1)=[0.05 32]

If yes you can make such a syntax work by defining
function P=%s_i_Points(i,v,P)
P.B(i)=v(1)
P.H(i)=v(2)
endfunction


Serge Steer
> 
> --
> View this message in context:
> http://mailinglists.scilab.org/tlist-function-tp4025634.html
> Sent from the Scilab users - Mailing Lists Archives mailing list
> archive at Nabble.com.
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
> 



More information about the users mailing list