How can I split a matrix into 4 regions?

3 visualizaciones (últimos 30 días)
Mariana
Mariana el 25 de En. de 2020
Respondida: Anmol Dhiman el 31 de En. de 2020
data = [0, 5:120; [(10:200)', zeros(191, 116)]]
Capture.PNG
  1 comentario
Sindar
Sindar el 29 de En. de 2020
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?

Iniciar sesión para comentar.

Respuestas (1)

Anmol Dhiman
Anmol Dhiman el 31 de En. de 2020
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

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by