How to split an array into two arrays?

7 vues (au cours des 30 derniers jours)
Mohammad Torabi
Mohammad Torabi le 20 Jan 2020
Commenté : Mohammad Torabi le 20 Jan 2020
Hi,
I have an array like x = [ 0:10] and need to split it into x1 = [x(0,1),x(4,5),x(8,9)] and x2 = [x1(2,3),x(6,7)]. I am able to do this by using loops but for big dara is very time consuming. Is there any other way to do this?
Thanks
  5 commentaires
Stephen23
Stephen23 le 20 Jan 2020
First reshape and then use indexing.
Mohammad Torabi
Mohammad Torabi le 20 Jan 2020
Thanks for your help. It works.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by