Make a variable

1 次查看(过去 30 天)
Alexandros
Alexandros 2011-11-25
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

采纳的回答

Titus Edelhofer
Titus Edelhofer 2011-11-25
Hi,
B = repmat('%s ', 1, x);
Titus
  1 个评论
Alexandros
Alexandros 2011-11-25
Yes MANNNNNNN
THANK YOU AMAZINGGGGGGGGGGGGGGGGGGGGG

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by