필터 지우기
필터 지우기

unknown numbers of input

조회 수: 2 (최근 30일)
khoirul hadi
khoirul hadi 2015년 10월 15일
편집: Guillaume 2015년 10월 15일
let say i have M X N matrix, and i want to split it based on its number of rows, example below is 3X5 matrix, so how can i get M variables (x,y,z) without knowing the number of M?
Matrix A became arrays :
1 1 1 1 1 x = 1 1 1 1 1
2 2 2 2 2 => y = 2 2 2 2 2
3 3 3 3 3 z = 3 3 3 3 3

답변 (2개)

Thorsten
Thorsten 2015년 10월 15일
Creating dynamically named variables should be avoided. Just use
A(i,:)
to get you desired vectors.
  댓글 수: 1
Guillaume
Guillaume 2015년 10월 15일
편집: Guillaume 2015년 10월 15일
Indeed. Maybe if khoirul explained his use case, we can explain why his question is a bad idea.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2015년 10월 15일

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by