make a matrix with size 100 x 1 with the same elements

I wanna to make a matrix with size 100 x 1 which all its elements are " A " ( character) ?
the same as this:
H=['A';'A';'A';'A'............];

1 件のコメント

Roger Stafford
Roger Stafford 2013 年 10 月 7 日
編集済み: Roger Stafford 2013 年 10 月 7 日
Use matlab's 'repmat' function. See its documentation at:
http://www.mathworks.com/help/matlab/ref/repmat.html

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

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 10 月 7 日

0 投票

H = blanks(100) .';
H(:) = 'A';

2 件のコメント

Andrei Bobrov
Andrei Bobrov 2013 年 10 月 7 日
Like written Roger in comment:
repmat('A',100,1)
Walter Roberson
Walter Roberson 2013 年 10 月 7 日
Yes, I am presenting an alternative. There are other methods as well, such as
H = char('A' * ones(100,1));

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

カテゴリ

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

質問済み:

2013 年 10 月 7 日

コメント済み:

2013 年 10 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by