[scilab-Users] How to automatically increase matrix name number

Mike Page Mike at Page-One.Waitrose.com
Fri Sep 24 10:18:27 CEST 2010


Hi Paul,

I think you can use execstr, like:

-->str='a=zeros(1,10)';
-->execstr(str);
-->a
 a  =
    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.

I have used execstr successfully for this kind of thing.  You can also use
the errcatch argument (see help text) to trap errors when executing strings,
which I use a lot for checking if files are named correctly and so on.

HTH
Mike.

  -----Original Message-----
  From: Carrico, Paul [mailto:paul.carrico at esterline.com]
  Sent: 24 September 2010 09:05
  To: users at lists.scilab.org
  Subject: [scilab-Users] How to automatically increase matrix name number


  All,

  In a loop I would like to create several matrix but their size as well as
their number/name number depend on the file results (they're automatically
created).

  Is it possible that the name number becomes a variable ?

  for i = 1 : n
      creation of A1[] / A2[] / A3[] .... An[]
  end for

  Please note each matrix size may be different


  Thanks for any advice

  Paul
----------------------------------------------------------------------------
----


Le prisent mail et ses pihces jointes sont confidentiels et destinis ` la
personne ou aux personnes visie(s) ci-dessus. Si vous avez regu cet e-mail
par erreur, veuillez contacter immidiatement l'expiditeur et effacer le
message de votre systhme. Toute divulgation, copie ou distribution de cet
e-mail est strictement interdite.

This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error, please contact the sender and
delete the email from your system. If you are not the named addressee you
should not disseminate, distribute or copy this email.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20100924/99135697/attachment.htm>


More information about the users mailing list