Not enough input arguments

1 visualización (últimos 30 días)
Seb apple
Seb apple el 29 de Jul. de 2020
Respondida: Steven Lord el 29 de Jul. de 2020
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 comentario
Sriram Tadavarty
Sriram Tadavarty el 29 de Jul. de 2020
Hi Seb,
Can you clear all the workspace and try? I see the output for your code placed and no errors.
Regards,
Sriram

Iniciar sesión para comentar.

Respuestas (1)

Steven Lord
Steven Lord el 29 de Jul. de 2020
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.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by