[Scilab-users] Vectorial form of fprintf Function

Calixte Denizet calixte.denizet at scilab-enterprises.com
Mon Mar 4 22:12:06 CET 2013


Hi Samuel,

You could try something like:
c = (1:10)';
fd=mopen("/tmp/foo.bar");
mfprintf(fd, "%5.3f\n", c);
mclose(fd);

If you need to print a matrix you can do
A=rand(3,4);
fd=mopen("/tmp/bar.foo","wt");
mfprintf(fd, "%5.3f %5.3f %5.3f %5.3f\n",A)
mclose(fd);

Best regards

Calixte

On 04/03/2013 21:40, Samuel Enibe wrote:
> Dear Sir,
>
> I would like to print a given column in a matrix with a specific 
> number of decimal places. The *format* function does not give  the 
> same number of decimal places for columns containing data of varying 
> length. On the other hand, *fprintf* and the like appear suitable for 
> single float at a time. Is there a version of *fprintf* and co that 
> can be used directly for a matrix?
>
> -- 
> Samuel Ogbonna Enibe
> University of Nigeria, Nsukka, Nigeria
> Tel: +2348063646798
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users


-- 
Calixte Denizet
Software Development Engineer
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
http://www.scilab-enterprises.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20130304/31aac222/attachment.htm>


More information about the users mailing list