필터 지우기
필터 지우기

Writing ~ using fprintf

조회 수: 5 (최근 30일)
David Corella López
David Corella López 2020년 12월 13일
댓글: David Corella López 2020년 12월 13일
Hello to everyone.
The point of this question is how to write the character ~ when using fprintf.
When I write it, I get the following message:
Warning: Escaped character '\~' is not valid.
Moreover, I'm wondering how to add a text before a mathematical expression, i.e.:
fprintf(f,'\~y\~-\~w %.6E & %.6E & %.6E & %.6E\\\\',A(1, :));
What sould I do in order to write that?
Thank you very much.

채택된 답변

Jan
Jan 2020년 12월 13일
The tilde can be printed directly without escaping:
fprintf('This is a tile: ~\n')
And what is the problem with adding text?
fprintf(f,'~y~-~w %.6E & %.6E & %.6E & %.6E\\\\', A(1, :));
  댓글 수: 2
David Corella López
David Corella López 2020년 12월 13일
Hello.
Firstly, thanks for your answer!
I didn't explain myself well enough.
Now, I've realized the problem is not really with the tilde but with the bar \. I need to print it, too, in order to write it in LaTeX.
David Corella López
David Corella López 2020년 12월 13일
Ok. I've already solved it. Thanks!

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by