Error extracting graph theory measures - brain connectivity toolbox

7 Ansichten (letzte 30 Tage)
Jose Teles
Jose Teles am 19 Sep. 2022
Kommentiert: Jose am 4 Okt. 2022
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? I also attach the connectivity matrix
Sorry but I am very new to programming and any suggesting would be welcomed.
Thanks in advance,
Jose
  10 Kommentare
Walter Roberson
Walter Roberson am 23 Sep. 2022
It is not possible to reach that line of code without having executed
n = size(D,1);
which would have complained if D was not passed in to the function.
Please go back and re-run the charpath(CM) call ... after, that is, having changed the line
ecc = nanmax(D,[],2);
at line 72, to be
ecc = max(D,[],2,'omitnan');
and saving the charpath.m file.
Jose
Jose am 4 Okt. 2022
Thank you Walter for your help this worked

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by