Spliting a n-by-3 Array into several different arrays.
이전 댓글 표시
So, I have the following array:
v =
[1 2 3;
-1 2 -3;
0 0 0;
1 -2 3;
1 2 3;
1 2 3;
0 0 0;
0 0 0;
1 1 1]
I would like to split it into several arrays that I can call upon later as follows:
v_1 = [1 2 3; -1 2 -3],
v_2 = [1 -2 3; 1 2 3; 1 2 3],
v_3 = [1 1 1];
How would I go about doing this. I would like to use the zeros as an indication of where to create another variable with the array indicated.
Thank you.
댓글 수: 5
Scott Salazar
2018년 9월 6일
편집: Scott Salazar
2018년 9월 6일
Scott Salazar
2018년 9월 6일
Scott Salazar
2018년 9월 6일
dpb
2018년 9월 7일
I know you asked that, but do NOT go down that perilous pathway..."There be dragons!"
Stephen23
2018년 9월 7일
"...but I would again like to call them each from a vector. Thoughts?"
Do NOT do that. Magically accessing variable names is one way the beginners force themselves into writing slow, complex, buggy code. Here is why:
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 App Building에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!