open-discussion > Error with extraction of graph theory measures
Showing 1-2 of 2 posts
Sep 19, 2022 03:09 PM | Jose Teles
Error with extraction of graph theory measures
Dear experts,
I have a 90x90 connectivity matrix and am trying to extract graph theory measures using the brain connectivity toolbox, in particular the characteristic path length.
I used the following code:
load('01_DWI_FP_MD_C_trafo_Tracts_CSD_FA_PASS' )
>> charpath(CM)
But then I get the following error message "Error using charpath. The distance matrix must not contain NaN values"
I checked and indeed there are several NaN values in the matrix can anyone provide suggestion on how to sort this error? Should the NaN be replaced by real values and if so how to do this? 0 or 1 values?
Sorry but I am very new to programming and any suggesting would be welcomed. I also attach the matrix
Thanks in advance,
Jose
I have a 90x90 connectivity matrix and am trying to extract graph theory measures using the brain connectivity toolbox, in particular the characteristic path length.
I used the following code:
load('01_DWI_FP_MD_C_trafo_Tracts_CSD_FA_PASS' )
>> charpath(CM)
But then I get the following error message "Error using charpath. The distance matrix must not contain NaN values"
I checked and indeed there are several NaN values in the matrix can anyone provide suggestion on how to sort this error? Should the NaN be replaced by real values and if so how to do this? 0 or 1 values?
Sorry but I am very new to programming and any suggesting would be welcomed. I also attach the matrix
Thanks in advance,
Jose
Feb 16, 2023 12:02 PM | Wentao Zeng
RE: Error with extraction of graph theory measures
I don't know about structrural connectivity so can't give you a
precise answer. But if nan indicates two nodes have no structural
connection then set to 0 is reasonable (which means you must assure
what is the meaning of nan in your matrix first).