필터 지우기
필터 지우기

Possible combinatios of integers 0-9 in triads

조회 수: 1 (최근 30일)
Niemand83
Niemand83 2017년 11월 5일
답변: Nasser Hakami 2019년 11월 16일
For some calculations I have the variables nx, ny, nz. Those variables can take the values of the integers 0-9 and I need all the possible [nx, ny, nz] combinations, for example (0, 0, 1), (0,1,0), (9,9,9) etc. How can I do this in Matlab ? Thank you in advance

채택된 답변

John D'Errico
John D'Errico 2017년 11월 5일
xyz = dec2base(0:999,10) - '0';
  댓글 수: 1
Niemand83
Niemand83 2017년 11월 5일
Thank you! It works. Now how can I export every possible variable to a different column in excel ? (first column: all the x values, second all the y values etc)

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

추가 답변 (1개)

Nasser Hakami
Nasser Hakami 2019년 11월 16일
i have the same question but differnt range
I have the m=9 variables a,b,c,d,e,f,g. Those variables can take the values of the integers [x,-y] = [0-15] and I need all the possible [a,b,c,d,e,f,g] combinations matrix (0, 0, 15), (0,14,1), (5,3,7) etc. always summation of any combinationi must be equal to 15
m ,x,y will be set as each case i need to simulate
appreciate any help

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by