필터 지우기
필터 지우기

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