How Can I convert a 1 by 1 array into multidimensional array?

For example i have
a=[1]
I want to convert it into
a=[1111 1111 1111
1111 1111 1111
1111 1111 1111]
Can anyone please help me here.

回答 (2 件)

Star Strider
Star Strider 2017 年 7 月 5 日

0 投票

One approach:
a = [1];
a = a*ones(1, 36);
a = reshape(a, [], 4);

カテゴリ

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

回答済み:

2017 年 7 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by