MATLAB: I can’t run the function because it says ‘Not enough input arguments’

erroefunction

This is how the function looks like:
function [M, Eigenvalues, Eigenvectors] = Tridiagonal_matrix(N, d, k)
if N>=2 && N<=10
M=full(gallery('tridiag', N, -k, d, -k));
[Eigenvalues, Eigenvectors] = eig(M);
else
disp('N value is invalid')
end

Best Answer

Show how you called it, including the lines of code where N, d, and k got assigned their values. You can't just click the green run triangle without providing those input values.
Related Question