Discussion:
[Scilab-users] How to remove 'Nan' in a matrix
Carrico, Paul
2018-11-08 14:54:22 UTC
Permalink
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
Dang Ngoc Chan, Christophe
2018-11-08 15:03:38 UTC
Permalink
Hello Paul,
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.
Carrico, Paul
2018-11-08 15:20:08 UTC
Permalink
M(isnan(M)) = []
:-)

Thanks Christophe it works fine


-----Message d'origine-----
De : users [mailto:users-***@lists.scilab.org] 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,
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
***@lists.scilab.org
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

Loading...