matlab - Csvwrite returns a single line output instead of multiple lines (displayed in notepad) -


aim

i want write .csv file in following format

1253.7500,1295.5000,-403.7500,1,0.000 1253.7500,1295.5000,-401.2500,1,0.000 1258.7500,1294.5000,-403.7500,1,0.000 1258.7500,1294.5000,-401.2500,1,0.000 1257.5000,1295.5000,-402.5000,1,0.000 

code if use .csvwrite follows

m = [3 6 9 12 15; 5 10 15 20 25; ...  7 14 21 28 35; 11 22 33 44 55]; csvwrite('test1.dat',m); type test1.dat 

matlab displays correctly this:

3,6,9,12,15 5,10,15,20,25 7,14,21,28,35 11,22,33,44,55 

problem

i want import program need above format if open created file in notepad looks this:

3,6,9,12,**155**,10,15,20,**257**,14,21,28,**3511**,22,33,44,55 

(the stars dont appear used them highlight problem area here 2 numbers combined)

is there way write in .csv file without happening ?

the problem lies within notepad, not code or matlab. using notepad++ displayed correctly as:

enter image description here

if used .csv instead of .dat format

m = [3 6 9 12 15; 5 10 15 20 25; ...  7 14 21 28 35; 11 22 33 44 55]; csvwrite('test1.csv',m); type test1.csv 

it can checked in excel , shown correctly:

enter image description here


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -