[scilab-Users] updating matrix

Adrien Vogt-Schilb vogt at centre-cired.fr
Tue May 31 11:59:48 CEST 2011


Hi

This will show you an example

A=[2 4 6 8 10];
A(3) = []   //deletes the 3rd element of A.


But be aware, if A is very big, this might be very time consuming. (I am 
not sure, thought)
You could prefer something as

B=A //once at the begining

B(3) = %nan  //when the third element should be "deleted"

if you do so beware of comparisons with nans: they always return false!
1==%nan
1>%nan
1<%nan
%nan == %nan



Le 31/05/2011 11:48, Carrico, Paul a écrit :
>
> Dear all
>
> I've the following matrix :
>
> A = [N1 N2 N3 .... Ni .... Nn ]' with n data
>
> In an iterative process, the idea is to decrease the size of the 
> matrix when the wanted value(integer) is found .
>
> i = 1 -> size = n
> i = 2 -> the ith value is removed => size = n-1
> and so on up to n = 1
>
> Is there a relevant way to do it without creating a temporary matrix B 
> -> copying the upper part/lower part of the matrix -> removing A and 
> renaming B in A ..... ?
>
> The aim is both to limit the number of iterations (and to limit the 
> time consuming) and to have a "clean" synthax !
>
> Thanks for any advice
>
> Regards
>
> Paul
>
> --------------------------------------------------------------------------------
>
>
> Le présent mail et ses pièces jointes sont confidentiels et destinés à la personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de votre système. 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.
>
>


-- 

*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/20110531/cacd70b4/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/20110531/cacd70b4/attachment.png>


More information about the users mailing list