[Scilab-users] How to remove 'Nan' in a matrix

classic Classic list List threaded Threaded
3 messages Options
Carrico, Paul Carrico, Paul
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] How to remove 'Nan' in a matrix

Dear All

 

I’m wondering how I can, remove the ‘Nan’ that appears in a matrix ( with “find” I guess)?

 

I’m nearly sure it comes from a div with 0. and I think I know why, but I’ve 2 options:

-          I can easily remove it and it’s not an issue and not relevant for the final result (out of scope),

-          Or I can add conditions to avoid this, but it’ll drastically speed down the CPU time (I’m using vectorization)

 

Thanks for your support

 

Paul

EXPORT CONTROL :
Cet email ne contient pas de données techniques
This email does not contain technical data

 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Christophe Dang Ngoc Chan Christophe Dang Ngoc Chan
Reply | Threaded
Open this post in threaded view
|

Re: How to remove 'Nan' in a matrix

Hello Paul,

> De : users [mailto:[hidden email]] De la part de
> Carrico, Paul Envoyé : jeudi 8 novembre 2018 15:54
>
> I'm wondering how I can, remove the 'Nan' that appears in a matrix ( with "find" I guess)?

Not sure what you mean by "remove" but for the matrix M, you can try something like

M(isnan(M)) = 0

HTH

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

Public
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Carrico, Paul Carrico, Paul
Reply | Threaded
Open this post in threaded view
|

Re: How to remove 'Nan' in a matrix

M(isnan(M)) = []
:-)

Thanks Christophe it works fine


-----Message d'origine-----
De : users [mailto:[hidden email]] De la part de Dang Ngoc Chan, Christophe Envoyé : jeudi 8 novembre 2018 16:04 À : Users mailing list for Scilab Objet : [EXTERNAL] Re: [Scilab-users] How to remove 'Nan' in a matrix

Hello Paul,

> De : users [mailto:[hidden email]] De la part de
> Carrico, Paul Envoyé : jeudi 8 novembre 2018 15:54
>
> I'm wondering how I can, remove the 'Nan' that appears in a matrix ( with "find" I guess)?

Not sure what you mean by "remove" but for the matrix M, you can try something like

M(isnan(M)) = 0

HTH

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

Public
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
users mailing list
[hidden email]
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.scilab.org_mailman_listinfo_users&d=DwIFAw&c=0hKVUfnuoBozYN8UvxPA-w&r=4TCz--8bXfJhZZvIxJAemAJyz7Vfx78XvgYu3LN7eLo&m=5MxZksxnKDdWnigvfYU0vPineJ_MKUtJA04CMbCl-BU&s=PEPq0FNRlHdknIM99pZwt3ax1jO9FxoOeT98mj8DrXE&e=

EXPORT CONTROL :
Cet email ne contient pas de données techniques
This email does not contain technical data
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users