Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
to export data to origin

Subject: to export data to origin

From: sk maidul haque

Date: 25 Apr, 2011 05:49:05

Message: 1 of 9

Is there any direct code around matlab to export a set of matrices to different workbook of origin file.
  I use to do it by exporting data to excel by xlswrite command and then importing excel sheet from origin workpage. The problem with this is that, when you save data through xlswrite command, it does not create a fullproof xls file. As a result, when you try to open this excel file, it gives warning messege that "the file is in different format than specified by file extension" and also the file is not directly importable from origin.
If you realy want to import the file from origin, you have to first open the matlab generated excel file and save it as some name.xls and the you can import the data in origin. This is a combersome process.
 Does anybody know, how to go around this problem ? I do not want to write matrices in notepad and then import into origin since notepad file does not have the facility to save different sheet.

Subject: to export data to origin

From: Nasser M. Abbasi

Date: 25 Apr, 2011 06:10:08

Message: 2 of 9

On 4/24/2011 10:49 PM, sk maidul haque wrote:
> Is there any direct code around matlab to export a set of matrices to different workbook of origin file.
> I use to do it by exporting data to excel by xlswrite command and then importing excel
> sheet from origin workpage. The problem with this is that, when you save data through xlswrite command,
> it does not create a fullproof xls file. As a result, when you try to open this excel file, it
> gives warning messege that "the file is in different format than specified by file extension"
> and also the file is not directly importable from origin.
> If you realy want to import the file from origin, you have to first open the matlab generated
> excel file and save it as some name.xls and the you can import the data in origin. This
> is a combersome process.
> Does anybody know, how to go around this problem ? I do not want to write matrices
> in notepad and then import into origin since notepad file does not have the facility to save different sheet.


What does

"export a set of matrices to different workbook of origin file"

mean?

I never heard this terminology. I have no idea what the above means.

"workbook" ? what is a workbook? What is an "origin file" ?

"different sheet"? sheet of what?

May be you can explain the above again, slowly and clearly?


--Nasser

Subject: to export data to origin

From: sk maidul haque

Date: 25 Apr, 2011 12:09:04

Message: 3 of 9

"Nasser M. Abbasi" <nma@12000.org> wrote in message <ip3380$jee$1@speranza.aioe.org>...
> On 4/24/2011 10:49 PM, sk maidul haque wrote:
> > Is there any direct code around matlab to export a set of matrices to different workbook of origin file.
> > I use to do it by exporting data to excel by xlswrite command and then importing excel
> > sheet from origin workpage. The problem with this is that, when you save data through xlswrite command,
> > it does not create a fullproof xls file. As a result, when you try to open this excel file, it
> > gives warning messege that "the file is in different format than specified by file extension"
> > and also the file is not directly importable from origin.
> > If you realy want to import the file from origin, you have to first open the matlab generated
> > excel file and save it as some name.xls and the you can import the data in origin. This
> > is a combersome process.
> > Does anybody know, how to go around this problem ? I do not want to write matrices
> > in notepad and then import into origin since notepad file does not have the facility to save different sheet.
>
>
> What does
>
> "export a set of matrices to different workbook of origin file"
>
> mean?
>
> I never heard this terminology. I have no idea what the above means.
>
> "workbook" ? what is a workbook? What is an "origin file" ?
>
> "different sheet"? sheet of what?
>
> May be you can explain the above again, slowly and clearly?
>
>
> --Nasser


There is a software named 'origin' to work around scientific data and to put the data in a systemetic manner. It's very popular to scientific community . you can say, its a substitute or mode advanced than microsoft excel. Like you have different spreadsheet in ms excel, you have different workbook in origin.
...maidul

Subject: to export data to origin

From: ImageAnalyst

Date: 25 Apr, 2011 14:36:14

Message: 4 of 9

What version of Excel are you using? Excel 2007 started using .xlsx
files though it can open .xls file and write them out. Does Origin
read/import xls files, xlsx files, or both?

What version of MATLAB do you use? MATLAB only started to handle the
xlsx files after a certain date of course.

If there's nothing in the file exchange you may have to write your own
Origin writer file, then upload it to the File Exchange.

Subject: to export data to origin

From: sk maidul haque

Date: 25 Apr, 2011 14:59:20

Message: 5 of 9

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <571f9efb-17b5-41c8-a732-3ddd1473f244@q6g2000prl.googlegroups.com>...
> What version of Excel are you using? Excel 2007 started using .xlsx
> files though it can open .xls file and write them out. Does Origin
> read/import xls files, xlsx files, or both?
>
> What version of MATLAB do you use? MATLAB only started to handle the
> xlsx files after a certain date of course.
>
> If there's nothing in the file exchange you may have to write your own
> Origin writer file, then upload it to the File Exchange.


Thanks for your attempt to reply my query. I am using excel 2007 and matlab 2007. But the problem is not with xls or xlsx files. I know, that Matlab 2007 version reads and write only xls and not xlsx, the latter being file extension for excel 2007. Since I am generating my file from matlab code, so it's certainly xls and origin has no problem to import xls file. Only thing is I am to open the file once and again re-save it as xls to make a fullproof xls file.
  Can you please elaborate the solution, you have given i.e. how to create origin writer file ?

Subject: to export data to origin

From: ImageAnalyst

Date: 25 Apr, 2011 15:52:52

Message: 6 of 9

I don't have a solution. I don't use Origin. You might contact
Ashish Uthama - he works at the Mathworks on file formats. He does
participate in this newsgroup often. Or just call him or tech
support.

I believe I've seen the message "the file is in different format than
specified by file extension" even with Excel and I think it was caused
by an xls file having xlsx extension or an xlsx file having an xls
extension.

By the way, I think you mean "foolproof" (or "correct") rather than
"fullproof."

Subject: to export data to origin

From: sk maidul haque

Date: 26 Apr, 2011 04:48:04

Message: 7 of 9








ImageAnalyst <imageanalyst@mailinator.com> wrote in message <6b7e4c92-aea8-4cbe-9409-14a73d5d0b68@z7g2000prh.googlegroups.com>...
> I don't have a solution. I don't use Origin. You might contact
> Ashish Uthama - he works at the Mathworks on file formats. He does
> participate in this newsgroup often. Or just call him or tech
> support.
>
> I believe I've seen the message "the file is in different format than
> specified by file extension" even with Excel and I think it was caused
> by an xls file having xlsx extension or an xlsx file having an xls
> extension.
>
> By the way, I think you mean "foolproof" (or "correct") rather than
> "fullproof."





yes, you can take the meaning of "fullproof" to be "correct". Actually the excel file (xls) generated by matlab is of smaller size, which is not imporatable from origin. But, once you open it and again save it as xls, it's file size becomes larger and then it becomes importable from origin. In this case, "fulproofl" may not be the correct terminology to use.
And how can I get the contact or email id of Mr. Ashish Uthama, the name you mentioned ?

Subject: to export data to origin

From: ImageAnalyst

Date: 26 Apr, 2011 16:58:58

Message: 8 of 9

On Apr 26, 12:48 am, "sk maidul haque" <skmaidulha...@gmail.com>
wrote:
> And how can I get the contact or email id of Mr. Ashish Uthama, the name you mentioned ?
---------------------------------------------
I guess you can call the Mathworks at 1-508-647-7000 and ask for him.
Or post a message here with his name in the subject line - he often
visits this newsgroup.

Subject: to export data to origin

From: Ashish

Date: 27 Apr, 2011 15:36:09

Message: 9 of 9


I am not familiar with origin. (Note: it helps post a link to make the
context clear to folks here.
http://www.originlab.com/index.aspx?go=Products/Origin&pid=926 )
You could contact their support for best means to import MATLAB data.

They seem to have something in their website:
http://www.originlab.com/www/helponline/Origin/en/Programming/mergedProjects/OriginC/Category/Matlab_(class).html
(Maybe you can modify it to load previously saved .mat files and import it
with the above code).


On the matter of having to open the file once outside MATLAB to make it
'valid':
What kind of data are you transferring? Maybe it is some date/time which
gets reformatted when you open Excel.
I cant think of much else since I dont have access to Origin to
investigate further.


Your best bet to get quick, official support is to contact technical
support ( http://www.mathworks.com/support/contact_us/ ) with a detailed
question.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us