필터 지우기
필터 지우기

What is the function for varargin?

조회 수: 3 (최근 30일)
Amra Rajuli
Amra Rajuli 2018년 3월 28일
댓글: Walter Roberson 2018년 3월 28일
I run a script and the error message was
">> quiver_bak(varargin)
Attempt to execute SCRIPT varargin as a function:
C:\Program Files\MATLAB\R2017b\toolbox\matlab\lang\varargin.m".
What i have to type as a function?
  댓글 수: 3
Amra Rajuli
Amra Rajuli 2018년 3월 28일
Thank you, I will remove the attachment
Walter Roberson
Walter Roberson 2018년 3월 28일
(I already removed it)

댓글을 달려면 로그인하십시오.

답변 (1개)

Stephen23
Stephen23 2018년 3월 28일
편집: Stephen23 2018년 3월 28일
Do NOT use varargin outside of any function: it only works inside of a function. Call your function like this:
quiver(X,Y,...)
Where X, Y, etc are any input variables or values that the function needs.
The code you attached (a copyrighted copy of quiver) has this example, note how it does not use the term varargin anywhere:
[x,y] = meshgrid(-2:.2:2,-1:.15:1);
z = x .* exp(-x.^2 - y.^2); [px,py] = gradient(z,.2,.15);
contour(x,y,z), hold on
quiver(x,y,px,py)

카테고리

Help CenterFile Exchange에서 Graphics Objects에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by