How to generate a matrix using permutations

1 回表示 (過去 30 日間)
Armin Z
Armin Z 2017 年 9 月 25 日
回答済み: KSSV 2017 年 9 月 25 日
How can I create a matrix where I compare different values of a function to itself, where the function depends on x variables which vary from the integer value y up to the integer z.
For example, if x =2, y=0 and z=1, then the possible functions would be f(0,0), f(0,1), f(1,0) and f(1,1). These would then be subtracted from each in a four by four matrix. For example the first column, first row would be f(0,0)-f(0,0).

回答 (1 件)

KSSV
KSSV 2017 年 9 月 25 日
x =2; y=0 ; z=1 ;
A = [y z] ;
iwant = perms(A)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by