How to call a matlab function?

I have to verify that my matrix code is correct by checking that for a 5x5 matrix, SS=I_5. How do I do that? This is the code I have for returning a matrix S of any size.
function S = S_Matrix(m)
S=zeros(m)
for ii= lim ;
for jj= lim ;
S(ii,jj)= sqrt(2/m)*sin*((pi/m)*(ii-(1/2))*(jj-(1/2)));
end
end
end

1 comentario

Rik
Rik el 23 de Nov. de 2020
Where is the function definition of lim?
Did you follow a basic Matlab tutorial?

Iniciar sesión para comentar.

Respuestas (1)

Chaitanya Mallela
Chaitanya Mallela el 27 de Nov. de 2020

0 votos

The above code cannot be executed as lim is not defined. Try initializing lim either as a variable or function with integer return value.

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Preguntada:

el 23 de Nov. de 2020

Respondida:

el 27 de Nov. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by