After using nchoosek function, how can i create variables for each answer?

Title says it all mostly. I created a matrix of 15x4 as a result of nchoosek (that gave me 15 answers) and i would like to be able to make 15 new variables; one for each answer (combination). Thank you in advance

 채택된 답변

Sean de Wolski
Sean de Wolski 2013년 5월 24일

0 개 추천

댓글 수: 5

Doesnt't work
It's telling you not to do this. Why do you want 15 different variables when you have them all packaged into one easy to accwess variable?
I want to perform a regression on each combination of 4 variables (obtained previously).
each cell contains 524 historical data of one particular index, that's why i don't use the whole 15x4 matrix
So index into it. To get the fourth row:
X(4,:)
This is much easier and much better than creating X4.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2013년 5월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by