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!