String scalar or character vector must have valid interpreter syntax

Rx(1)= "(cos(seta)-0.3 * sin(seta)) * Rx_" ;
Ry(1)= "(0.3*cos(seta) + sin(seta)) * Ry_";
there are my variable and
I wrote the plot title like this
title(Rx(1)+" + "+Ry(1));
but I recieve this error message,' String scalar or character vector must have valid
interpreter syntax' . How can I fix it?

 채택된 답변

Adam Danz
Adam Danz 2020년 7월 31일
편집: Adam Danz 2020년 7월 31일
You probably want something like
title(sprintf('%.2f + %.2f', Rs(1), Ry(1)))
See sprintf for more info.
Update
Set interpretter to 'none',
title(Rx(1)+" + "+Ry(1),'Interpreter','none');

댓글 수: 3

no,,, I just want like this, and It works actually, however I get warning error massage also. I don't know why I get warning...
I didn't see that the Rx and Ry values had quotes. In the furture, it would be helpful if you format your code using the [>] button in the question/comment editor.
I've updated my answer with the solution.
Interpreter none, or use \_

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Entering Commands에 대해 자세히 알아보기

제품

릴리스

R2019b

질문:

2020년 7월 31일

댓글:

2020년 7월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by