How to devide a matrix (n x 1) into 2 matrixes equally ?
古いコメントを表示
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 件のコメント
Steven Lord
2025 年 1 月 29 日
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.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!