matlab single quote problem

조회 수: 1 (최근 30일)
Maria
Maria 2020년 5월 28일
댓글: Maria 2020년 5월 28일
how should I output this sentence in single quote instead of double quote? Because change the double quote to single quote directly is not work

채택된 답변

Brent Kostich
Brent Kostich 2020년 5월 28일
You need to use brackets when creating a multi-part sentence like that, which is equal to horzcat. Also, you need to use character segments, not strings.
pi = ['The approximation on ', num2str(n), ' terms is ', num2str(round(pi*4, 4))];
  댓글 수: 1
Maria
Maria 2020년 5월 28일
works for me . Thanks !!!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by