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

2 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Walter Roberson
Walter Roberson el 18 de En. de 2020
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);

Más respuestas (0)

Categorías

Más información sobre Coordinate Transformations en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by