필터 지우기
필터 지우기

How can I split a matrix into 4 regions?

조회 수: 2 (최근 30일)
Mariana
Mariana 2020년 1월 25일
답변: Anmol Dhiman 2020년 1월 31일
data = [0, 5:120; [(10:200)', zeros(191, 116)]]
Capture.PNG
  댓글 수: 1
Sindar
Sindar 2020년 1월 29일
What do you mean by "split"? Do you want new variables? Do you want an equally-sized matrix that tells you which region each element is in? Is there logic to the split?

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

답변 (1개)

Anmol Dhiman
Anmol Dhiman 2020년 1월 31일
Hi Mariana,
You have not mentioned about the criteria of splitting. So, I am assuming that is based on the values of the elements. I am also assuming that you want to store the values of one region together. Hence, you can use an array to store them.
There is no direct approach for splitting the matrix randomly. You can see the below link to extract elements from matrix based on condition and use this. Apply four times( as there are four regions) based on each condition.
Hope it helps

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by