Error using fprintf Unable to convert 'sym' value to 'double'.
3 views (last 30 days)
Show older comments
Bernard Finik
on 17 Jan 2020
Answered: Walter Roberson
on 18 Jan 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 = %.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.
0 Comments
Accepted Answer
Walter Roberson
on 18 Jan 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);
0 Comments
More Answers (0)
See Also
Categories
Find more on Coordinate Transformations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!