What is the function for varargin?

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 件のコメント

Stephen23
Stephen23 2018 年 3 月 28 日
編集済み: Stephen23 2018 年 3 月 28 日
@Amra Rajuli: note that the code you have uploaded is clearly labelled "Copyright 1984-2002 The MathWorks, Inc.", and you have probably broken your license conditions by distributing TMW code. I would suggest that you remove copyright code from your question.
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 日

0 投票

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)

質問済み:

2018 年 3 月 28 日

コメント済み:

2018 年 3 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by