Make a variable

1 visualización (últimos 30 días)
Alexandros
Alexandros el 25 de Nov. de 2011
I have to make a variable which has the sign %s as many times as the variable x is.
This means if x = 15 then i need to make
B = [%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s]
While also keep the spaces between them. So I can paste it into textscan.
Is there a way to produce B. I could make B as 2 columns one for % and one for s but when I transpose it the result is completely wrong.
%%%%%%%%%%%%%% ssssssssssssss
Any ideas? Thank you very much

Respuesta aceptada

Titus Edelhofer
Titus Edelhofer el 25 de Nov. de 2011
Hi,
B = repmat('%s ', 1, x);
Titus
  1 comentario
Alexandros
Alexandros el 25 de Nov. de 2011
Yes MANNNNNNN
THANK YOU AMAZINGGGGGGGGGGGGGGGGGGGGG

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Variables en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by