fplot and quiver return "Error using box"

Hello,
I keep getting this error when using the fplot and quiver functions, even when using the most simple example from the documentation.
fplot(@(x) sin(x))
Error using box
Too many input arguments.
Error in fplot (line 169)
box(cax,'on');
[X,Y] = meshgrid(0:6,0:6);
U = 0.25*X;
V = 0.5*Y;
quiver(X,Y,U,V,0)
Error using box
Too many input arguments.
Error in quiver (line 96)
box(cax,'on');
I have updated MATLAB and have been scouring the internet for answers. I am running macOS Sonoma. Has anyone run into these issue before?

1 件のコメント

Dyuman Joshi
Dyuman Joshi 2024 年 2 月 15 日
Please share the output of -
which box -all
/MATLAB/toolbox/matlab/graph2d/box.m

サインインしてコメントする。

 採用された回答

Star Strider
Star Strider 2024 年 2 月 15 日

0 投票

See if you have something else in your MATLAB search path named ‘box’.
which box -all
That is the only thing I can think of that would throw that error.
Running it here:
which box -all
/MATLAB/toolbox/matlab/graph2d/box.m
If anything else show up, that could be the problem.
.

5 件のコメント

Mathilde
Mathilde 2024 年 2 月 15 日
Thanks!
This is what I have:
>> which box -all
/Users/mathildeplacek/cobratoolbox/papers/2023_BarrierRound/3isotropic/PolytopeSamplerMatlab-develop/coverage/problems/basic/box.m
/Users/mathildeplacek/cobratoolbox/external/analysis/PolytopeSamplerMatlab/coverage/problems/basic/box.m % Shadowed
/Applications/MATLAB_R2023b.app/toolbox/matlab/graph2d/box.m % Shadowed
Mathilde
Mathilde 2024 年 2 月 15 日
I assume the third one should be the one that is not shadowed?
Dyuman Joshi
Dyuman Joshi 2024 年 2 月 15 日
The 3rd one should not be shadowed.
Remove/rename the other two files.
Mathilde
Mathilde 2024 年 2 月 15 日
That has fixed it. Thank you so much!
Star Strider
Star Strider 2024 年 2 月 15 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeVector Fields についてさらに検索

製品

リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by