Saving data to Excel

How to save a set of variable names and matrix to an Excel so that the file has

Y       X1        X2

2       10         1

3       15         0

4      20         1

.        .            .

.        .            .

.       .             .

 

1 Answer



0



Try xlsWrite - commands as below

varnames = "Y" $| "X1" $|"X2";
y = {2,3,4};
x1 = {10,15,20};
x2 = {1,0,1};
xlsWriteSA(varnames', "c:\\temp\\yourfile.xls", "A1", 1,"");
xlsWriteM(y~x1~x2, "c:\\temp\\yourfile.xls", "A2", 1,"");

Your Answer

1 Answer

0

Try xlsWrite - commands as below

varnames = "Y" $| "X1" $|"X2";
y = {2,3,4};
x1 = {10,15,20};
x2 = {1,0,1};
xlsWriteSA(varnames', "c:\\temp\\yourfile.xls", "A1", 1,"");
xlsWriteM(y~x1~x2, "c:\\temp\\yourfile.xls", "A2", 1,"");


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.