[Scilab-users] Formatting

Rafael Guerra jrafaelbguerra at hotmail.com
Sun Jan 7 21:18:13 CET 2018


Why not using decimal floating point output?

mfprintf(fd,'%.2f\n\r', points(i,2));



Regards,

Rafael



-----Original Message-----
From: users [mailto:users-bounces at lists.scilab.org] On Behalf Of James Holland
Sent: Sunday, January 07, 2018 8:49 PM
To: users at lists.scilab.org
Subject: [Scilab-users] Formatting



I'm trying to generate a file for an arbitrary waveform generator, the format is csv but I am having problems formatting the output, this is my current attempt

<code>

for i = 1:nr

    mfprintf(fd,'%i', points(i,1));

    mfprintf(fd, ',');

    mfprintf(fd,'%.2E\n\r', points(i,2)); end </code>



Its close it puts a '+' in the output for positive E numbers and the AWG software rejects this. For example I have:



<code>

97,-2.50E+00

98,-2.50E+00

99,-2.50E+00

100,-2.50E+00

101,6.00E+00

102,6.00E+00

103,6.00E+00

104,6.00E+00

</code>



but I need:



<code>

97,6.00E00

98,6.00E00

99,6.00E00

100,6.00E00

101,-2.50E00

102,-2.50E00

103,-2.50E00

</code>



is it possible to achieve this just using formatting tags?

TIA James









--

Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html

_______________________________________________

users mailing list

users at lists.scilab.org<mailto:users at lists.scilab.org>

http://lists.scilab.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20180107/7c119d58/attachment.htm>


More information about the users mailing list