matlab single quote problem
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
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))];
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Numeric Types에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!