필터 지우기
필터 지우기

) Write a function centervalue(M) that returns the value of the central element of matrix M. You may assume that M has an odd number of rows and columns. Have centervalue call your function halfway. >> centervalue(magic(5)) ans = 13

조회 수: 1 (최근 30일)
Plz help!!
  댓글 수: 4

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

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 9월 20일
편집: KALYAN ACHARJYA 2018년 9월 20일
% Please note center value for odd square matrics only % Following code for all square and non-square also
function centre_value=centervalue(M)
[rows colm]=size(M);
center_value=M(round(rows/2),round(colm/2));
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by