- X: a nx2 matrix
- y: not sure how it is used in plotData. Most likely a nx2 matrix as well, one value for each point of X?
- model: a ML model?
- varargin: other optional input arguments. Doesn't seem to be used at all in the function
while executing this code in MATLAB iam getting an error like visualizeBoundary requiers more input arguments?
조회 수: 1 (최근 30일)
이전 댓글 표시
function visualizeBoundary(X, y, model, varargin)
plotData(X, y)
x1plot = linspace(min(X(:,1)), max(X(:,1)), 100)';
x2plot = linspace(min(X(:,2)), max(X(:,2)), 100)';
[X1, X2] = meshgrid(x1plot, x2plot);
vals = zeros(size(X1));
for i = 1:size(X1, 2)
this_X = [X1(:, i), X2(:, i)];
vals(:, i) = svmPredict(model, this_X);
end
hold on
contour(X1, X2, vals, [0 1], 'Color', 'b');
hold off;
end
댓글 수: 0
답변 (1개)
Yongjian Feng
2021년 11월 21일
How did you call this function?
It looks like this function needs:
So you need at least the first three input arguments, right?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Argument Definitions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!