[scilab-Users] Weird behaviour dealing with matrices

Adrien Vogt-Schilb vogt at centre-cired.fr
Tue Jun 14 15:26:41 CEST 2011


Hi Edouardo

This is not a bug, but a feature!

you should read this : 
http://wiki.scilab.org/howto/global%20and%20local%20variables

In the commented example, look for the following line :

   x(3)=56          // note that at this point x=[0 0 56] because of 3. above, *not* [45 0 56]

this is exactly want happened to you



On 13/06/2011 22:11, Eduardo Torrecillas wrote:
> Hi all,
>
> I have some piece of code and noticed some strange behaviour. As the 
> code is complex and involves external compilation, it is a little bit 
> difficult to post it here, so I will try to explain it in a general way.
>
> At some point in the code, I have a structure called interpolados, 
> having 3 matrices. So, I have
>
> interpolados(1).matriz
> interpolados(2).matriz
> interpolados(3).matriz
>
> all of them are sized 497 x 95.
>
> Later on, when trying to substitute a column of one of this matrices, 
> I get it destroyed.
> The syntax I'm using is:
>
> interpolados(1).matriz(:,3)=13
>
> I was expecting to maintain the matrix and change only its third 
> column, all with 13. Actually what I'm getting is that 
> interpolados(1).matriz is no longer 497 x 95, but 497 x 1 (only 1 
> column, all full with 13).
>
> System summary: Ubuntu 10.10 64bit + Scilab 5.3.2
>
> Has anybody experienced that? Any issues?
>
> Regards,
>
>
> -- 
> Eduardo Torrecillas


-- 

*Adrien Vogt-Schilb*

Research Fellow

vogt at centre-cired.fr <mailto:vogt at centre-cired.fr>

Tel: (+33) 1 43 94 73 96

Fax: (+33) 1 43 94 73 70

CIRED

	

45 bis, Av de la Belle Gabrielle

F-94736 Nogent-sur-Marne

http://www.centre-cired.fr/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20110614/358a93bc/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logocired.png
Type: image/png
Size: 4092 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20110614/358a93bc/attachment.png>


More information about the users mailing list