What is the best way to flag some elements in MATLAB? using NaN or Inf? or something else?

Posted by Kamran Bigdely Shamloo on Stack Overflow See other posts from Stack Overflow or by Kamran Bigdely Shamloo
Published on 2010-03-24T06:14:53Z Indexed on 2010/03/24 8:43 UTC
Read the original article Hit count: 267

Filed under:

As you may know, in many occasions, there is a need to flag some elements of a matrix. For example when we have weighted adjacency matrix, and our graph is not fully connected, we have to flag some elements to show that there is no edge between those nodes. The question is how to do that? Is it better to put NaN or Inf on that elements in the matrix? or something elese(such as -1)?

© Stack Overflow or respective owner

Related posts about matlab