- Posts: 1
Outputting result matrix using SamUL to excel
- cosmith57
- Topic Author
Less
More
19 Dec 2014 15:00 #2863
by cosmith57
Outputting result matrix using SamUL to excel was created by cosmith57
After making a matrix of data, I want to save it into a csv excel file. But when I do, the indices are ignored. For example:
data[0,0]
data[0,1]=-2
data[1,0]=5
data[1,1]=1
WriteTextFile("/Users/cp....csv",data)
Returns 3 -2 5 1 in my excel sheet (each number in a different column in row 1).
Is there not a way to write data matrices to excel? (Using a Mac)
data[0,0]
data[0,1]=-2
data[1,0]=5
data[1,1]=1
WriteTextFile("/Users/cp....csv",data)
Returns 3 -2 5 1 in my excel sheet (each number in a different column in row 1).
Is there not a way to write data matrices to excel? (Using a Mac)
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
22 Dec 2014 11:13 #2864
by pgilman
Replied by pgilman on topic Outputting result matrix using SamUL to excel
Hello, WriteTextFile() writes a string to the file.
Here's SamUL script that should work (Note that in SAM 2014.11.24, LK replaces SamUL):
data[0,0]
data[0,1]=-2
data[1,0]=5
data[1,1]=1
n_rows = length(data)
n_cols = length(data[0])
str_data = ""
str_row = ""
for (i=0;i
Here's SamUL script that should work (Note that in SAM 2014.11.24, LK replaces SamUL):
data[0,0]
data[0,1]=-2
data[1,0]=5
data[1,1]=1
n_rows = length(data)
n_cols = length(data[0])
str_data = ""
str_row = ""
for (i=0;i
Please Log in or Create an account to join the conversation.
Moderators: pgilman