Need help debugging an error with Latex Interpreter and sprintf

For some reason I keep getting errors with the interpreter when I try to put in this code:
title(sprintf('Pressure $(1-M_\infty^2)u_{xx}+u_{yy}=0$, $M_\infty=%s$', Minf),'Interpreter','latex')
Anyone have suggestions for the formatting?

 채택된 답변

Star Strider
Star Strider 2017년 12월 3일
You need to use two consecutive \\ in fprintf and sprintf.
This works:
title(sprintf('Pressure $(1-M_\\infty^2)u_{xx}+u_{yy}=0$, $M_\\infty=%s$', Minf),'Interpreter','latex')

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by