Hello! I noticed that whenever I use the syntaxes residue() and roots(), I get the error "too many input arguments". I copy pasted this code directly from matlab's documentation, but I keep getting the error. I tried to run the code here and it works. Is there any way to fix it?
p = [3 -2 -4];
r = roots(p)
r = 2×1
1.5352 -0.8685

댓글 수: 1

What does the below line show up for you?
which roots
/MATLAB/toolbox/matlab/polyfun/roots.m

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

답변 (1개)

VBBV
VBBV 2022년 7월 24일

0 개 추천

p = [3 -2 -4];
TESTE(p) ;% give the input argument matrix p for the function TESTE in command window
ans = 2×1
1.5352 -0.8685
function r = TESTE(p)
r = roots(p);
end
If you give the input argument matrix , p to the function TESTE in command window, then it will work, It seems you have not given any input arguments and calling function directly

댓글 수: 1

VBBV
VBBV 2022년 7월 24일
편집: VBBV 2022년 7월 24일
It could also be that you dont have any input arguments to defined function file or m-file with name TESTE

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

카테고리

도움말 센터File Exchange에서 Octave에 대해 자세히 알아보기

태그

질문:

2022년 7월 24일

편집:

2022년 7월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by