Not enough input arguments

1 次查看(过去 30 天)
Seb apple
Seb apple 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