Generation of a matrix

how to generate a matrix of large size as 9^275 having column size 275 and row size of 9^275 in matlab.Possible elements of this matrix is 1,0,-1 and each row should have a diffrent value.

1 件のコメント

per isakson
per isakson 2012 年 4 月 28 日
That's a huge matrix!

サインインしてコメントする。

回答 (4 件)

Junaid
Junaid 2012 年 5 月 2 日

0 投票

you can generate matrix by number of ways. For example:
m = zeros(m,n);
m is the matrix of m rows and n columns. If matrix is too big and contains many zeros (sparse matrix) then sparse matrix is good option.
But in your case, your matrix is too big. I doubt that any PC can create that.
Why don't you create matrix of size 100000 x 10000 and see the memory consumption of your system. As your range for values is 0, -1, 1.
then I suggest you to use integer class instead of double.
Sean de Wolski
Sean de Wolski 2012 年 5 月 2 日

0 投票

Not possible in MATLAB and not possible in the Universe as we know it :)
Walter Roberson
Walter Roberson 2012 年 5 月 2 日

0 投票

That is not possible.
You have 3 choices per position, and 275 positions per row, leading to 3^275 possible distinct rows. But you have 9^275 rows, which is more than the distinct possibilities, so by the pigeon-hole principle you will have duplicates.
Richard Brown
Richard Brown 2012 年 5 月 2 日

0 投票

To give you some context,
9^275 = 26102980312143604580379781426139335779091260301758026221495303393196039344305009624874488017227324790317412920525253886011853217074287636537729904547128731845728160914486066244742089352609334182138245049106257642108402738856230144495829015803277090696341313660249

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2012 年 4 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by