How many nan matlab




















Search Answers Clear Filters. Answers Support MathWorks. Search Support Clear Filters. Support Answers MathWorks. Search MathWorks. MathWorks Answers Support. Open Mobile Search. Trial software. You are now following this question You will see updates in your activity feed. You may receive emails, depending on your notification preferences. You may receive emails, depending on your notification preferences.

Show older comments. Vote 2. Accepted Answer: Oleg Komarov. I have a matrix for which i need for each row to compute the number of non nan observations. I am wondering if it is possible to compute it without any loop. NaN 0. Accepted Answer. Oleg Komarov on 31 Jul Cancel Copy to Clipboard. Jasmine Karim: it looks like you have multiply nested cell arrays. Please upload that variable in a. Jasmine Karim on 18 Sep I edited my original question because I think it was incorrectly worded.

I have a matrix that holds 6 matrices. In each of those matrices is a basic output that looks like A attached here. Answers 1. Stephen on 19 Sep Edited: Stephen on 19 Sep There are four NaN's in your cell array:. In fact most of the cells contain numeric data:. Well, in any case, I showed you how to count the NaN's, as your question requested. Jasmine Karim on 19 Sep Cancel Copy to Clipboard.

This is a straight forward question and given you haven't shown any attempt to solve it, I am hesitant to provide an answer Start by making some nonsense data. NaN NaN 0. NaN 1. Now we want to sum up all the ones in each column. We have the SUM function that does that.

To get the final answer we want to find which column has the smallest sum. The MIN function usually returns the smallest values, but if you read the documentation, the second output argument is the index of the minimum value.

Thank you Daniel for your answer, I will answer more questions than I ask to keep the community going when I have time. Thank you for your answer! More Answers 2.



0コメント

  • 1000 / 1000