필터 지우기
필터 지우기

Putting spacing between strings

조회 수: 1 (최근 30일)
Yoshi
Yoshi 2016년 1월 23일
편집: jgg 2016년 1월 23일
I am trying to print out something like this:
A (10 blank spaces) B (10 blank spaces) C
any ideas?
  댓글 수: 3
Yoshi
Yoshi 2016년 1월 23일
ABC are supposed to be singular values such as 7,8,9
jgg
jgg 2016년 1월 23일
Then the second example there should work. I'll submit it as an answer.

댓글을 달려면 로그인하십시오.

답변 (1개)

jgg
jgg 2016년 1월 23일
편집: jgg 2016년 1월 23일
You can do this by sending them to strings then concatenating them:
A = 1;
B = 8;
C= 9;
space = ' ';
str = [num2str(A),space,num2str(B),space,num2str(C)];
disp(str)
or you can print str to a file (it's unclear what you mean by "print out")

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by