Filter löschen
Filter löschen

What is the function for varargin?

3 Ansichten (letzte 30 Tage)
Amra Rajuli
Amra Rajuli am 28 Mär. 2018
Kommentiert: Walter Roberson am 28 Mär. 2018
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 Kommentare
Amra Rajuli
Amra Rajuli am 28 Mär. 2018
Thank you, I will remove the attachment
Walter Roberson
Walter Roberson am 28 Mär. 2018
(I already removed it)

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Stephen23
Stephen23 am 28 Mär. 2018
Bearbeitet: Stephen23 am 28 Mär. 2018
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)

Kategorien

Mehr zu Graphics Objects 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