Matrix for two variables
2 ビュー (過去 30 日間)
古いコメントを表示
I have 2 variables, a and b with respective values 1.123456789 and 3.123456789. Please help me to generate the matrix for the possible combination based on the formula 2^n, n = integer number 1 to 50. E.g if n=3, the output should be a matrix of 8 by 3:
1.123456789 1.123456789 1.123456789
1.123456789 1.123456789 3.123456789
1.123456789 3.123456789 1.123456789
1.123456789 3.123456789 3.123456789
3.123456789 1.123456789 1.123456789
3.123456789 1.123456789 3.123456789
3.123456789 3.123456789 1.123456789
3.123456789 3.123456789 3.123456789
1 件のコメント
Azzi Abdelmalek
2012 年 10 月 12 日
編集済み: Azzi Abdelmalek
2012 年 10 月 12 日
what is the link between a, b and 2^n. Combinaison of what?
採用された回答
Andrei Bobrov
2012 年 10 月 12 日
編集済み: Andrei Bobrov
2012 年 10 月 12 日
use function ff2n from Statistics Toolbox
n = 3;
a = [1.123456789 , 3.123456789];
ii = ff2n(n)+1;
out = a(ii);
その他の回答 (0 件)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!