Not enough input arguments

1 回表示 (過去 30 日間)
Seb apple
Seb apple 2020 年 7 月 29 日
回答済み: Steven Lord 2020 年 7 月 29 日
Hi, I cant understand why this wont run and what is meant by not enough input arguments. please help here is my code.
syms e q n
c=0;
g(n)=e/(2*(q+(1i*n*c)-((n)^2)));
N = 17;
l_start = ((N-1)/2)-2;
u_start = (N-1)/2;
l_end = l_start-N+3;
u_end = u_start-N+3;
f = diag(ones(1,N)) + diag(g(l_start:-1:l_end), -2) + diag(g(u_start:-1:u_end), 2);
F=det(f)==0;
F = det(F);
fimplicit(F)
xlabel 'epsilon'
ylabel 'omega'
xlim([0 5])
ylim([0 10])
the error codes i recieve are
% Not enough input arguments.
%
% Error in sym (line 191)
% n
%
% Error in syms (line 227)
% defined = sym(zeros(1, length(args)));
%
% Error in base2 (line 1)
% syms e q n
  1 件のコメント
Sriram Tadavarty
Sriram Tadavarty 2020 年 7 月 29 日
Hi Seb,
Can you clear all the workspace and try? I see the output for your code placed and no errors.
Regards,
Sriram

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

回答 (1 件)

Steven Lord
Steven Lord 2020 年 7 月 29 日
I suspect you've written or downloaded a sym.m that's taking precedence over the one included in Symbolic Math Toolbox. In my installation of release R2020a line 191 of sym.m is not just the letter n.
To check this, use the which function.
which -all sym
If that command shows other sym.m files that are not underneath matlabroot, rename them.

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by