Discussion:
[Q:] How to use "xlswrite()" in Octave on Mac OS X Mavericks?
TAISO, Renpoo
2014-08-29 05:38:37 UTC
Permalink
Hi there!
I'm new to here, and my name is Renpoo.

I'm a norvice user of Octave for a few months, and want to do some
signal processing job for a project. In the proj., I've already borrowed
some programs from my colleague and those codes are using the structured
data to contain every kind of resulting parameters.

I want to examine these resulting data in the Excel, since it is too
much amount and hard to examine in the "Workspace" window.

But the output command "xlswrite()" cannot work well with Octave 3.8.0
(GUI) on Mavericks.
If I want to use it, first of all, I have to install Java package, but I
can't, even though my Mac had already been installed the Java 1.6.0. as
Java Virtual Machine.

So, what should I do?
Is there any way to use xlswrite() in Octave on my Mac?
Or, is there another method useful to display/write-to-file those
resulting (structured) data?

Thanks in advance,
Renpoo
Philip Nienhuis
2014-08-29 10:37:24 UTC
Permalink
Post by TAISO, Renpoo
Hi there!
I'm new to here, and my name is Renpoo.
I'm a norvice user of Octave for a few months, and want to do some
signal processing job for a project. In the proj., I've already borrowed
some programs from my colleague and those codes are using the structured
data to contain every kind of resulting parameters.
I want to examine these resulting data in the Excel, since it is too
much amount and hard to examine in the "Workspace" window.
But the output command "xlswrite()" cannot work well with Octave 3.8.0
(GUI) on Mavericks.
If I want to use it, first of all, I have to install Java package, but I
can't, even though my Mac had already been installed the Java 1.6.0. as
Java Virtual Machine.
So, what should I do?
Is there any way to use xlswrite() in Octave on my Mac?
Or, is there another method useful to display/write-to-file those
resulting (structured) data?
(Disclaimer: I do not have a Mac so I'm not sure if the below will work
*that* easily, so keep fingers crossed)

If you're OK with the newer .xlsx Excel format, you do not need Java.
E.g. LibreOffice can easily read & write .xlsx as well so you can inspect
your data with it. Or with a recent enough Excel, if you insist.

Have you got the io package installed? The newest version is 2.2.3; that
should work with Octave-3.8.x
If not:

more off
pkg install -forge -verbose io ## Not sure if that'll work on OSX;
maybe other ways are needed

So, if you have the io package installed *and loaded*, you should be able to
write .xlsx files right away.
Just ignore the various messages the first time you use xlswrite.
Those messages just inform you what options ("interfaces") the io package
has detected for spreadsheet I/O, it only searches the first time you invoke
a function for spreadsheet I/O. (FYI, it should default to the "OCT
interface", the one that doesn't require Java.)

Philip




--
View this message in context: http://octave.1599824.n4.nabble.com/Q-How-to-use-xlswrite-in-Octave-on-Mac-OS-X-Mavericks-tp4666271p4666273.html
Sent from the Octave - General mailing list archive at Nabble.com.
TAISO, Renpoo
2014-08-29 12:10:24 UTC
Permalink
Thanks Philip,

But it causes the error message like below. (after following your
instruction)
Post by TAISO, Renpoo
funcTest
OCT*; (* = default interface)
file /Users/renpoo/Projects/TheProj/Sounds/abc.xlsx couldn't be
unpacked. Is it the proper file format?
The code for xlswrite() is like this.
xlswrite( outputDataFileName, res, 'Sheet1', 'A1:XFD1048576', 'oct' );
Is it necessary to install another package?

Thanks in advance,
Renpoo
Post by TAISO, Renpoo
Hi there!
I'm new to here, and my name is Renpoo.
I'm a norvice user of Octave for a few months, and want to do some
signal processing job for a project. In the proj., I've already borrowed
some programs from my colleague and those codes are using the structured
data to contain every kind of resulting parameters.
I want to examine these resulting data in the Excel, since it is too
much amount and hard to examine in the "Workspace" window.
But the output command "xlswrite()" cannot work well with Octave 3.8.0
(GUI) on Mavericks.
If I want to use it, first of all, I have to install Java package, but I
can't, even though my Mac had already been installed the Java 1.6.0. as
Java Virtual Machine.
So, what should I do?
Is there any way to use xlswrite() in Octave on my Mac?
Or, is there another method useful to display/write-to-file those
resulting (structured) data?
(Disclaimer: I do not have a Mac so I'm not sure if the below will work
*that* easily, so keep fingers crossed)
If you're OK with the newer .xlsx Excel format, you do not need Java.
E.g. LibreOffice can easily read & write .xlsx as well so you can inspect
your data with it. Or with a recent enough Excel, if you insist.
Have you got the io package installed? The newest version is 2.2.3; that
should work with Octave-3.8.x
more off
pkg install -forge -verbose io ## Not sure if that'll work on OSX;
maybe other ways are needed
So, if you have the io package installed *and loaded*, you should be able to
write .xlsx files right away.
Just ignore the various messages the first time you use xlswrite.
Those messages just inform you what options ("interfaces") the io package
has detected for spreadsheet I/O, it only searches the first time you invoke
a function for spreadsheet I/O. (FYI, it should default to the "OCT
interface", the one that doesn't require Java.)
Philip
--
View this message in context: http://octave.1599824.n4.nabble.com/Q-How-to-use-xlswrite-in-Octave-on-Mac-OS-X-Mavericks-tp4666271p4666273.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
https://lists.gnu.org/mailman/listinfo/help-octave
Philip Nienhuis
2014-08-29 15:14:23 UTC
Permalink
Please answer BELOW the text - makes it easier to follow and to answer.
Post by TAISO, Renpoo
Thanks Philip,
But it causes the error message like below. (after following your
instruction)
funcTest
OCT*; (* = default interface)
That's good.
Post by TAISO, Renpoo
file /Users/renpoo/Projects/TheProj/Sounds/abc.xlsx couldn't be
unpacked. Is it the proper file format?
The code for xlswrite() is like this.
xlswrite( outputDataFileName, res, 'Sheet1', 'A1:XFD1048576', 'oct' );
A1:XFD1048576 is an enormous array......(1048576 rows X 16384 columns).
You can simply specify an empty string ('', two consecutive single or double
quotes)

And I think you may not need to specify "oct", you can leave the last two
parameters altogether and it should just work.
Post by TAISO, Renpoo
Is it necessary to install another package?
I don't think so.

The unpack error points to a different problem.
Can you make an .xlsx file with Excel with some random data or so and try to
1. Read it with Octave, using xlsread
2. Add another sheet to it with xlswrite?

Philip




--
View this message in context: http://octave.1599824.n4.nabble.com/Q-How-to-use-xlswrite-in-Octave-on-Mac-OS-X-Mavericks-tp4666271p4666278.html
Sent from the Octave - General mailing list archive at Nabble.com.
TAISO, Renpoo
2014-08-29 22:37:44 UTC
Permalink
I got it!!
Thanks Philip!!!


There were
1. Mistake in replacing string for the output filename.
2. Implement errors in original codes.


But now, I can see the resulting data cells in Excel!
Thanks a lot!

Renpoo
Post by Philip Nienhuis
Please answer BELOW the text - makes it easier to follow and to answer.
Post by TAISO, Renpoo
Thanks Philip,
But it causes the error message like below. (after following your
instruction)
funcTest
OCT*; (* = default interface)
That's good.
Post by TAISO, Renpoo
file /Users/renpoo/Projects/TheProj/Sounds/abc.xlsx couldn't be
unpacked. Is it the proper file format?
The code for xlswrite() is like this.
xlswrite( outputDataFileName, res, 'Sheet1', 'A1:XFD1048576', 'oct' );
A1:XFD1048576 is an enormous array......(1048576 rows X 16384 columns).
You can simply specify an empty string ('', two consecutive single or double
quotes)
And I think you may not need to specify "oct", you can leave the last two
parameters altogether and it should just work.
Post by TAISO, Renpoo
Is it necessary to install another package?
I don't think so.
The unpack error points to a different problem.
Can you make an .xlsx file with Excel with some random data or so and try to
1. Read it with Octave, using xlsread
2. Add another sheet to it with xlswrite?
Philip
--
View this message in context: http://octave.1599824.n4.nabble.com/Q-How-to-use-xlswrite-in-Octave-on-Mac-OS-X-Mavericks-tp4666271p4666278.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
https://lists.gnu.org/mailman/listinfo/help-octave
Philip Nienhuis
2014-08-30 09:58:27 UTC
Permalink
Post by TAISO, Renpoo
I got it!!
Thanks Philip!!!
There were
1. Mistake in replacing string for the output filename.
2. Implement errors in original codes.
But now, I can see the resulting data cells in Excel!
(Hmmm, my remark about top-posting didn't trickle down .... :-) )

Thanks for your feedback - on my side I'm pleased to know that the io
package seems to works fine on OSX as well.
(I have no Mac available for testing the io pkg, so I have to rely on
occasional info from OSX users)

Philip




--
View this message in context: http://octave.1599824.n4.nabble.com/Q-How-to-use-xlswrite-in-Octave-on-Mac-OS-X-Mavericks-tp4666271p4666291.html
Sent from the Octave - General mailing list archive at Nabble.com.
TAISO, Renpoo
2014-08-30 10:24:06 UTC
Permalink
Sorry, Mr. Philip,

But your suggestions worked fine besides my bug fix.
Thnx!

Renpoo
Post by Philip Nienhuis
Post by TAISO, Renpoo
I got it!!
Thanks Philip!!!
There were
1. Mistake in replacing string for the output filename.
2. Implement errors in original codes.
But now, I can see the resulting data cells in Excel!
(Hmmm, my remark about top-posting didn't trickle down .... :-) )
Thanks for your feedback - on my side I'm pleased to know that the io
package seems to works fine on OSX as well.
(I have no Mac available for testing the io pkg, so I have to rely on
occasional info from OSX users)
Philip
--
View this message in context: http://octave.1599824.n4.nabble.com/Q-How-to-use-xlswrite-in-Octave-on-Mac-OS-X-Mavericks-tp4666271p4666291.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
https://lists.gnu.org/mailman/listinfo/help-octave
Loading...