What is the best way to flag some elements in MATLAB? using NaN or Inf? or something else?
- by Kamran Bigdely Shamloo
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)?