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
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
2013 年 10 月 7 日
H = blanks(100) .';
H(:) = 'A';
2 件のコメント
Andrei Bobrov
2013 年 10 月 7 日
Like written Roger in comment:
repmat('A',100,1)
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 Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!