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 comentario

Roger Stafford
Roger Stafford el 7 de Oct. de 2013
Editada: Roger Stafford el 7 de Oct. de 2013
Use matlab's 'repmat' function. See its documentation at:
http://www.mathworks.com/help/matlab/ref/repmat.html

Iniciar sesión para comentar.

Respuestas (1)

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

2 comentarios

Like written Roger in comment:
repmat('A',100,1)
Yes, I am presenting an alternative. There are other methods as well, such as
H = char('A' * ones(100,1));

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Preguntada:

el 7 de Oct. de 2013

Comentada:

el 7 de Oct. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by