How to devide a matrix (n x 1) into 2 matrixes equally ?
Afficher commentaires plus anciens
I have some matrixes, and i need them to be devided into 2 parts equally, and the only part I use is the first part of it. For example, the matrix is A1 that contains 140 values (140 x1), second matrix is A2 contains 53 values (50 x 1), and so on. For matrix A1, I need to take the first 70 values, for matrix A2, i take the first 27 values, and so on. It has not to be in one loop to devide those matrixes all at once. An example only for 1 matrix would be helpful for me.
A1=rand(140,1);
A1d= ...? %is first half part of A1
I hope somebody can help me with my problem.
Thanks in advance.
1 commentaire
Steven Lord
le 29 Jan 2025
Are you trying to dynamically create variables with numbered names like x1, x2, x3, etc.? You can do this, but should you do this? The general consensus is no. That Discussions post explains why this is generally discouraged and offers several alternative approaches.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Matrix Indexing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!