Calculate the mean of a peak.

2 visualizaciones (últimos 30 días)
Patrick Nijkamp
Patrick Nijkamp el 21 de Feb. de 2020
Comentada: Guillaume el 21 de Feb. de 2020
I want to calculate the means of the peaks, i tried using regionprops. but it gave me an error:
Undefined function 'regionprops' for input arguments of type 'double'.
the name of the array i want to analyse, is flow and had a value of 347488x1 double
mask = flow > 98;
props = regionprops(mask, flow, 'MeanIntensity');
meanValues = [props.MeanIntensity];
  5 comentarios
Adam
Adam el 21 de Feb. de 2020
Editada: Adam el 21 de Feb. de 2020
"not yet"
Then that is the answer to your error. It can't find the function because it isn't there! The error message for these things can often be a bit misleading to those who haven't seen it loads of times already because the reference to type 'double' is totally irrelevant and what it almost always means is simply that no function of that name can be found on the path, irrespective of what the input argument types are.
To be honest I don't know that you would ever get that error for a function that does actually exist, but which you pass a double to rather than a string or whatever it does expect, unless the author of the function has gone out of their way to program exactly that error message because Matlab does not do type-checking like that when calling functions.
Guillaume
Guillaume el 21 de Feb. de 2020
Well, the type would be relevant for class member functions but yes in the majority of cases the type is completely irrelevant and unfortunately beginners tend to focus on the type part of the error message rather than the undefined part.
For that reason, a long time ago, I suggested to Mathworks to modify the error message to put less emphasis on the type and maybe add a suggestion that most likely the function doesn't exist. I believe it still sits as Bug/Enhancement Submitted.

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by