Calculate the mean of a peak.

1 次查看(过去 30 天)
Patrick Nijkamp
Patrick Nijkamp 2020-2-21
评论: Guillaume 2020-2-21
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 个评论
Adam
Adam 2020-2-21
编辑:Adam 2020-2-21
"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 2020-2-21
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by