"Nan" values ​​appear when I run the program. How can I remove them?

I have added photos for you to understand the problem:

8 commentaires

If you added words too to help us understand the problem that would be even better!
It is very difficult to select data loaded from EXCELL. How can I get "Nan"?
Getting NaN is easy....divide zero with zero....
If it is a cell array (which I assume it must be) then you can replace the NaNs with empty elements [] instead, though whether that is any better or just replacing one thing with another equally unhelpful one I don't know. You cannot simply remove all NaNs though and retain the 2d structure of the data. There has to be 'something' in each cell location, you can't just have a 2d array in which some cells contain 'nothingness'
The question is not clear. To explain or fix, what your code does, we have to see the relevant part of the code. If the NaNs should be replaced, we have to know the data type of the shown matrix and the value you want to get instead.
Please, Muhendisleksi, do not let us guess the details.
'KESIN KOORDINATLAR' NaN NaN 'YAKLASIK KOORDINATLAR' NaN NaN 'KENAR OLCMELERI' NaN NaN NaN 'DOGRULTU OLCMELERI' NaN NaN NaN 'So'
'NN' 'Y (m)' 'X (m)' 'NN' 'Y (m)' 'X (m)' 'DN' 'BN' 'KENAR (m)' 'ms (mm)' 'DN' 'BN' 'DOGRULTU (g)' 'md (cc)' NaN
102 164,526000000000 7849,47400000000 107 719,676000000000 7969,94800000000 102 103 459,192000000000 3 102 108 0 10 10
103 608,285000000000 7731,37300000000 108 342,243000000000 8404,16000000000 103 107 263,297000000000 5 102 107 66,6561300000000 10 NaN
NaN NaN NaN NaN NaN NaN 107 108 575,324000000000 4 102 103 96,8179300000000 10 NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
This is the excel file that the program installs. I wanted to destroy the "nan" there.
Adam
Adam le 15 Août 2017
Modifié(e) : Adam le 15 Août 2017
What do you mean by 'destroy'? Like I said, data has a structure. Your data is in a 2d structure. If you simply remove all the NaNs it will collapse to 1d and lose all its structure. Youre data appears to be ~90% NaNs though which is a little suspicious!
NaNs are the result of an indeterminate operation. So you did something where the computer did not have a valid result to place there.
Essentially, it is best if you show how the NaNs were created. Then you can "remove" them by not creating them in the first place.

Connectez-vous pour commenter.

Réponses (0)

Catégories

Modifié(e) :

le 15 Août 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by