How to call a matlab function?

조회 수: 1 (최근 30일)
Viridiana Varela
Viridiana Varela 2020년 11월 23일
답변: Chaitanya Mallela 2020년 11월 27일
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
Rik
Rik 2020년 11월 23일
Where is the function definition of lim?
Did you follow a basic Matlab tutorial?

댓글을 달려면 로그인하십시오.

답변 (1개)

Chaitanya Mallela
Chaitanya Mallela 2020년 11월 27일
The above code cannot be executed as lim is not defined. Try initializing lim either as a variable or function with integer return value.

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by