Error using fprintf Unable to convert 'sym' value to 'double'.

fprintf(nru,'{ %.3f uta1 + %.2f uta2 = -%.2f\n',[UI1,SG13,SG12]);
fprintf(nru,'{ %.3f uta1 + %.2f uta2 = -%.2f\n\n',[SG13,UI2,SG23]);
fprintf(nru,'uta 1 = %.4g\n\n',xSoa);
fprintf(nru,'uta 2 = %.4g\n\n',ySob);
fprintf(nru,'V3 = 1/(pierwiastek(1 + %.4s^2 + %.4s^2)) = %.4s\n\n',[xSoa,ySob,V31]);
fprintf(nru,'V1 = %.4g * %.4g = %.4g\n\n',[xSoa,V31,V11]);
fprintf(nru,'V2 = %.4g* %.4g = %.4g\n\n',[ySob,V31,V21]);
fprintf(nru,'VL1= [ %.4g ; %.4g ; %.4g ]',VL1);
When i use '%s'
In my txt, i dont have any numbers.
"Error using fprintf
Unable to convert 'sym' value to 'double'.
Error in WXY4 (line 281)
fprintf(nru,'uta 1 = %.4g\n\n',xSoa);"
Please help.

 Réponse acceptée

fprintf(nru,'{ %.3f uta1 + %.2f uta2 = -%.2f\n',[UI1,SG13,SG12]);
fprintf(nru,'{ %.3f uta1 + %.2f uta2 = -%.2f\n\n',[SG13,UI2,SG23]);
fprintf(nru,'uta 1 = %s\n\n', char(xSoa));
fprintf(nru,'uta 2 = %s\n\n', char(ySob));
fprintf(nru,'V3 = 1/(pierwiastek(1 + %s^2 + %s^2)) = %s\n\n', char(xSoa), char(ySob), char(V31));
fprintf(nru,'V1 = %s * %s = %s\n\n', char(xSoa), char(V31), char(V11));
fprintf(nru,'V2 = %s * %s = %s\n\n', char(ySob), char(V31), char(V21));
fprintf(nru,'VL1= [ %.4g ; %.4g ; %.4g ]',VL1);

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Produits

Version

R2019b

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by