brain-networks/edge-centric_demo

error about the example code

Closed this issue · 2 comments

Hi,
I try to run the example code on my PC. However, the error ocurred as following.

Error using pdist (line 373)
Error evaluating distance function '@(x,y)(mean(x~=y,2))'.

Error in fcn_profilesim (line 20)
pd = pdist(mat,hdl);

Error in example_code (line 35)
s = fcn_profilesim(mat);

Caused by:
Error using ~=
Matrix dimensions must agree.

Could you please tell me how to fix this error?

Hello,

Are you running just the example code? Or using your own data? Since the 'mat' variable fed into this function (https://github.com/brain-networks/edge-centric_demo/blob/main/example_code.m#L29) is a square matrix, it is hard to fathom how the function could get a dimension mismatch.

The other possibility that comes to mind is a MATLAB versioning complication... where possibly the pdist function has changed. Could you tell us which version of MATLAB you are using? We have designed the code with version 2019a and also tested with 2020a. Otherwise, somehow there is a complication in the pdist function being used, perhaps there is an alternative pdist function in your path?

--Josh

Hello,

Are you running just the example code? Or using your own data? Since the 'mat' variable fed into this function (https://github.com/brain-networks/edge-centric_demo/blob/main/example_code.m#L29) is a square matrix, it is hard to fathom how the function could get a dimension mismatch.

The other possibility that comes to mind is a MATLAB versioning complication... where possibly the pdist function has changed. Could you tell us which version of MATLAB you are using? We have designed the code with version 2019a and also tested with 2020a. Otherwise, somehow there is a complication in the pdist function being used, perhaps there is an alternative pdist function in your path?

--Josh

Hi,
Thanks for your reply, I just run the example code using the example_data.mat. My MATLAB version is The R2016a. Thanks for your advice. I will try it on the lastest version.