yeatmanlab / AFQ

Automated Fiber Quantification
75 stars 52 forks source link

AFQ_RenderFibers, to use minmax, you might need: #19

Open njhunsak opened 7 years ago

njhunsak commented 7 years ago

Just recently, I've not been able to use the AFQ_RenderFibers scripts because the command 'minmax' can no longer be found.

To use 'minmax', you might need:
  minmax - Neural Network Toolbox

Error in AFQ_RenderFibers (line 466)
    mx = minmax(coordsAll(1,:));

Any thoughts on why this may be happening?

Naomi

htakemur commented 6 years ago

I guess that this is coming from Simulink.

I have tested two environment; one with Simulink and the other without Simulink. In the latter case, I reproduced your error.

gamorosino commented 6 years ago

I solved this issue manually implementing the "minmax" function in MATLAB and adding the path where the function is ( i.e. "addpath(genpath('/home/gamorosino/my_functions/'));" )

the code of the m-file of the function "minmax.m":

function AR = minmax(A) %MINMAX Returns the matrix of minimum and maximum values of the input matrix % Returns the M x 2 matrix AR of minimum and maximum values for each % row of A, where A is a M x N matrix.

AR0 = min(A,[],2); AR1 = max(A,[],2); AR=[AR0, AR1 ];

end