![]() ![]() ![]() ![]() Microsoft Excel, in particular, locks files that it has open so they can't be read or written to by other programs. If you can do with a trailing space, you do not need to build the format string with repetition, as fprintf can automatically recycle it for all the inputs: fprintf('%.8g ',a,b,c) Another reason you can't open x.out for writing may be that it already exists and you have it open in another program. Also, you can use the format specifier %g, which automatically prints integer values without decimals: fprintf(strjoin(),a,b,c) You can dynamically build the format string using repmat and strjoin. That is, should be printed as 4 4.1, not as 4 4.10000 or 4.00000 4.10000.Ĭ = % example with 9 decimal figures This answer assumes you don't need trailing decimal zeros. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |