MATLAB Answers

matlab single quote problem

조회 수: 3(최근 30일)
Maria
Maria 28 May 2020
댓글: Maria 28 May 2020
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

Sign in to comment.

채택된 답변

Brent Kostich
Brent Kostich 28 May 2020
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 28 May 2020
works for me . Thanks !!!

Sign in to comment.

추가 답변(0개)


Translated by