Wed 01 Apr 2015 10:19:30 AM UTC, original submission:
Using Octave-3.8.1 from standard Ubuntu 14.04 repositories (64-bit OS)
I have found some weird behavior of num2str function. Sometimes it produces additional blank line.
c = [
-0.00000 0.71500 -0.00000
-0.00000 -0.71500 0.00000
1.23760 -1.40040 0.00000
-1.23760 -1.40040 0.00000
];
% Produces additional blank line
num2str(c,'%3.8f %3.8f %3.8f \n')
% Also produces additional blank line
num2str(c(1:3,:),'%3.8f %3.8f %3.8f \n')
% However, this does not produce the blank line
num2str(c(3:4,:),'%3.8f %3.8f %3.8f \n')
When I use larger matrix (more rows), the problem repeats after every 3 lines - it is probably some general problem, independent on what exactly is on the 3rd line...
Also affects Octave 3.8.2, Matlab doesn't have this problem
|