필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Write a function sides_products(M) that given a matrix M returns a 2-by-2 matrix containing the 4 products of the numbers in each of M’s 4 sides (i.e., the outside rows and columns of M) starting with the top side and going in clockwise order. ***

조회 수: 1 (최근 30일)
plz help

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 9월 20일
편집: KALYAN ACHARJYA 2018년 9월 20일
function mat=sides_products(M)
[rows colm]=size(M);
m_11=M(round(rows/2),round(colm/2))* M(round(rows/2)-1,round(colm/2));
m_12=M(round(rows/2),round(colm/2))* M(round(rows/2),round(colm/2)+1);
m_21=M(round(rows/2),round(colm/2))* M(round(rows/2),round(colm/2)-1);
m_22=M(round(rows/2),round(colm/2))* M(round(rows/2)+1,round(colm/2));
mat=[m_11,m_12;m_21,m_22];
end
  댓글 수: 4
Guillaume
Guillaume 2018년 9월 20일
@Kalyan,
In my opinion, it would be better if you didn't give full solutions to obvious homework problems particularly when the person does not appear to have made any effort at solving them.
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 9월 20일
@Guillaume Sir,
I totally agree I will definitely consider it in the future.

이 질문은 마감되었습니다.

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by