Filter löschen
Filter löschen

Attempt to execute SCRIPT varargin as a function:

1 Ansicht (letzte 30 Tage)
Hla Hla
Hla Hla am 14 Aug. 2022
Kommentiert: Matt J am 15 Aug. 2022
if ndims(img) ~= 3
error('first argument should be a 3D image');
end
% in case of a label image, return a vector with a set of results
if ~islogical(img)
labels = unique(img);
labels(labels==0) = [];
epcd = zeros(length(labels), 1);
for i = 1:length(labels)
epcd(i) = imEuler3dDensity(img==labels(i), varargin{:});
end
return;
end
% Process user input arguments
delta = [1 1 1];
conn = 6;
while ~isempty(varargin)
var = varargin{1};
if ~isnumeric(var)
error('option should be numeric');
end
% option is either connectivity or resolution
if isscalar(var)
conn = var;
else
delta = var;
end
varargin(1) = [];
end
% Euler-Poincare Characteristic of each component in image
chi = imEuler3dEstimate(img, conn);
In this coding, following error
Attempt to execute SCRIPT varargin as a function:
C:\Program Files\mATLAB\R2019a\toolbox\matlab\lang\varargin.m

Akzeptierte Antwort

Matt J
Matt J am 14 Aug. 2022
Your function does not begin with the function declaration line.
  3 Kommentare
Matt J
Matt J am 15 Aug. 2022
You're welcome but please Accept-click the answer to indicate that your question was resolved.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type 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