Error using slice: Too many input arguments

조회 수: 2 (최근 30일)
Stephen
Stephen 2023년 9월 21일
이동: Voss 2023년 9월 21일
When attempting to run the example code in the documentation for the slice command in either R2020b or R2022b, I receive "Error using slice. Too many input arguments." Using the "Run in 2023b" tool for this posting it apparently completes okay. However, I do not have access to 2023b yet in my organization. Here is what I'm getting from both versions currently installed:
>> [X,Y,Z] = meshgrid(-2:.2:2);
V = X.*exp(-X.^2-Y.^2-Z.^2);
xslice = [-1.2,0.8,2];
yslice = [];
zslice = 0;
slice(X,Y,Z,V,xslice,yslice,zslice)
Error using slice
Too many input arguments.
>>
Is anyone else having this issue?

채택된 답변

Voss
Voss 2023년 9월 21일
이동: Voss 2023년 9월 21일
Runs OK for me in R2022a.
Maybe you have another function called "slice". Check this on the command line:
which -all slice
/MATLAB/toolbox/matlab/specgraph/slice.m
  댓글 수: 2
Stephen
Stephen 2023년 9월 21일
이동: Voss 2023년 9월 21일
That was the problem! There is a suite of internal tools and apparently 'slice.m' is one of the files. After removing those folders from the path the Matlab slice function works fine. Thank you!
Voss
Voss 2023년 9월 21일
이동: Voss 2023년 9월 21일
You're welcome!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by