MATLAB Answers


NaN entries problem !

Asked by Ano
on 3 Nov 2017
Latest activity Edited by Ano
on 3 Nov 2017

Hello! I have 2 matrices which I would like to add them (simple addition +) but I get in the resulting matrix some NaN entries , Knowing that non of the 2 matrices contain not even a one NaN entry , I would like to know how these NaN entries are generated and how can I get rid of them ?! I have used the following code to see where is the problem


and I get A1=[] (empty) and I have changed the intervals (1000:1500) several timeand I keep getting A1 empty but as I change (1:end) A1 is not empty Note: I couldn't attach the matrices they are larger then the permitted size! Thank you!


Log in to comment.


1 Answer

Answer by Steven Lord
on 3 Nov 2017
 Accepted Answer

One possibility:

>> x = -Inf;
>> y = Inf;
>> z = x+y
z =


Log in to comment.

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today