Re: [Scilab-users] Array of struct

2013-03-01 Thread amiege
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.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Array of struct

2013-03-01 Thread amiege
Samuel GOUGEON wrote
//a : is actually needed, but here:
pts($+1) = temp(:)
 
 Sorry amiege, i have forgotten clearing pts before issuing this command,
 and its result is not the expected one. By the way, what's the expected
 result? Do you wish 
 a) to add temp(1:$) as a whole, as a _single_ new element of pts(), or
 b) to add each element temp(i) as a new corresponding element in pts($+i),
in a distributive way?

I would prefer to have the whole of the struct temp to be pts($+1), so that
pts(i) contains all the information related to the data file that has been
parsed, so I think that's a). pts(i) would then be a struct which would
match what temp is or was when it was constructed.

I will try the various solutions suggested and report back which one works
best.

Thanks,

Arnaud 




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


Re: [Scilab-users] Array of struct

2013-03-01 Thread amiege
amiege wrote
 I would prefer to have the whole of the struct temp to be pts($+1), so
 that pts(i) contains all the information related to the data file that has
 been parsed, so I think that's a). pts(i) would then be a struct which
 would match what temp is or was when it was constructed.
 
 I will try the various solutions suggested and report back which one works
 best.
 
 Thanks,
 
 Arnaud



seems to work. I then need to index into pts using pts(i,j) where i is the
file number and j is the jth element of the original temp. I think that
solves that question, unless someone tells me otherwise.

Thanks again,

Arnaud




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


Re: [Scilab-users] Loading functions in Scilab

2013-02-27 Thread amiege
Stefan Du Rietz wrote
 On 2013-02-27 13:14, Dang, Christophe wrote:
 
 You can also load all the functions in a directory with
 
 getd(path/my_directory)
 
 Regards
 Stefan

Thanks, I'll use that for now and look into building a library later.

Arnaud




--
View this message in context: 
http://mailinglists.scilab.org/Loading-functions-in-Scilab-tp4026070p4026078.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Using double quote character in regular expressions

2013-02-27 Thread amiege
Hi,

I am trying to scan a file using mopen, mtell and mgetl. I need to check
each line against different regular expressions, one of them having some
double quote characters inside it and that's causing me trouble. The regular
expression is as follows:



but that generates an error in Scilab (5.4.0):



The lines I am trying to read look line of the following:


Any suggestion on how to do this? I have been scratching my head and
searching on Google for some time, but to no avail.

Many thanks in advance,

Arnaud



--
View this message in context: 
http://mailinglists.scilab.org/Using-double-quote-character-in-regular-expressions-tp4026079.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Using double quote character in regular expressions

2013-02-27 Thread amiege
Antoine Monmayrant wrote
 I cannot read your code and error samples.
 Is that a problem on the email you send?
 
 Antoine
 ___
 users mailing list

 users@.scilab

 http://lists.scilab.org/mailman/listinfo/users

Sorry about this, not sure why that is. Display looks OK on 
http://mailinglists.scilab.org/Using-double-quote-character-in-regular-expressions-td4026079.html
http://mailinglists.scilab.org/Using-double-quote-character-in-regular-expressions-td4026079.html
 
.

Anyway, I think I have answered my own question. The trick appears to be to
use 2 double quote characters and remove the / characters enclosing the
expression. Not sure if the whole of the code definitely works, but progress
has been made.

Thanks,

Arnaud



--
View this message in context: 
http://mailinglists.scilab.org/Using-double-quote-character-in-regular-expressions-tp4026079p4026081.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Getting rid of Modelica info pop-up window in Xcos

2013-01-31 Thread amiege
Clément David-2 wrote
 Hello,We can not support 'silent' modelica compilation however some of
 ourinternal non-regression test re-define messagebox to silent any
 popupwindow using the following snip.--function btn = messagebox(msg,
 msgboxtitle, msgboxicon, buttons,ismodal)btn =
 0;endfunctionimportXcosDiagram(SCI
 +/modules/xcos/demos/ModelicaBlocks/RLC_Modelica.xcos);xcos_simulate(scs_m,
 4);--Clément DavidScilab Enterprises

Thanks, I have since then switched to a normal Xcos model so the problem
has gone away. However, I will definitely try the messagebox function you
suggest if I ever revert to using a COSELICA model.

Arnaud



--
View this message in context: 
http://mailinglists.scilab.org/Getting-rid-of-Modelica-info-pop-up-window-in-Xcos-tp4025830p4025846.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Getting rid of Modelica info pop-up window in Xcos

2013-01-29 Thread amiege
Hi,
I am running an Xcos model which contains some COSELICA blocks. Every time I
run it, the following window pops up:

http://mailinglists.scilab.org/file/n4025830/modelica_info.jpg 
This is fine for interactive simulation, but I am trying to run the model
iteratively as part of an optimization routine, which means that I end with
a lot of Java pop-up windows to close. So far, I have limited the amount of
iterations in the optimization to avoid crashing the software with too many
windows, but I would now like to  increase it. Does anybody know to turn
this pop-up window off for scripted simulations, given that COSELICA is
undocumented?
Thanks in advance,
Arnaud



--
View this message in context: 
http://mailinglists.scilab.org/Getting-rid-of-Modelica-info-pop-up-window-in-Xcos-tp4025830.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users