Importing matrix from Excel

Hi i´m trying to import a Matrix from Excel, in this way

e = SpreadsheetReadM("bb.xls", "A1:b2", "1")

"bb" is the name of the file

in the range is the matrix     1      1

1       1

the sheet is the number 1, after submit  e = SpreadsheetReadM("bb.xls", "A1:b2", "1"), and then "print e" i get in the output window

-2.1470248e+009

afterwards i tried to fix it by submitting c=scalerr(e), and next "print c" and i get in the output window 0.000

i dont really know whatelse can i do to get the matrix in the excel spreadsheet

greetings

 

 

6 Answers



0



There is one small error in your code that would cause an error. The third input to spreadSheetReadM should be a scalar value. However, in your code, the third input is in quotation marks which makes it a string. Change your code to this:

e = spreadSheetReadM("bb.xls", "A1:B2", 1);

and it should work.

aptech

1,773


0



Thanks for your help, but i´ve just tried and it didnt work ....

any other idea ??



0



The second most likely option is that the file does not exist in you current GAUSS working directory. You can return the list of files in your current working directory with the filesa command. To print out a list of all files in your GAUSS current working directory that end with a .xls extension, enter:

filesa("*.xls");

If bb.xls is printed to the screen, then it is in your current working directory. If it is NOT printed to the screen, then it is in another directory.

Let us know if that works.

aptech

1,773


0



it worked !!! thanks !!!



0



I just realized that my answer may not have been explicit enough. Am I correct to assume that when you ran the filesa command, you found that the file bb.xls was NOT in your current working directory. So you changed your GAUSS current working directory to the folder which contains bb.xls and were then able to load the file with the spreadSheetReadM command?

aptech

1,773


0



yes i did it !!! i worked fine, thanks a lot

Your Answer

6 Answers

0

There is one small error in your code that would cause an error. The third input to spreadSheetReadM should be a scalar value. However, in your code, the third input is in quotation marks which makes it a string. Change your code to this:

e = spreadSheetReadM("bb.xls", "A1:B2", 1);

and it should work.

0

Thanks for your help, but i´ve just tried and it didnt work ....

any other idea ??

0

The second most likely option is that the file does not exist in you current GAUSS working directory. You can return the list of files in your current working directory with the filesa command. To print out a list of all files in your GAUSS current working directory that end with a .xls extension, enter:

filesa("*.xls");

If bb.xls is printed to the screen, then it is in your current working directory. If it is NOT printed to the screen, then it is in another directory.

Let us know if that works.

0

it worked !!! thanks !!!

0

I just realized that my answer may not have been explicit enough. Am I correct to assume that when you ran the filesa command, you found that the file bb.xls was NOT in your current working directory. So you changed your GAUSS current working directory to the folder which contains bb.xls and were then able to load the file with the spreadSheetReadM command?

0

yes i did it !!! i worked fine, thanks a lot


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.