The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Matrix copy
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

DataConv

Germany
60 Posts

Posted - 10/29/2013 :  05:35:39 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 9.0.0G SR2
Operating System: W7 Pro SP1

I have created a matrix with a single sheet, but multiple layers (e.g. all the same dimension but different data). Since the different layer contain different data, i also adjusted the data type of each layer. I now want to copy the matrix 'as is' to do some data processing without loosing the original one. So i use the 'mcopy' X-function. But even with the 'fullcopy' Option, the data type (!) is not kept. That is bad especially for complex numbers. Okay - i could split to real and imaginary first, then do the copy - but that is just a work-around.
Any ideas?

Example:
MBook1->MSheet1->{(1):double,(2):double,(3):complex,(4):int}
gets
MBook1->MSheet2->{(1):double,(2):double,(3):double,(4):double}

greg

USA
1379 Posts

Posted - 10/30/2013 :  10:57:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Technically, the sheet ( in a matrixbook or workbook ) is the layer and the data is stored in an object in the sheet ( a column in a worksheet or object in a matrixsheet ).

The mcopy X-Function works at the object level and should preserve the data formatting.

This should work:

mcopy im:=[MBook1]MSheet1!1 om:=[MBook1]MSheet2!1 fullcopy:=1;
mcopy im:=[MBook1]MSheet1!2 om:=[MBook1]MSheet2!2 fullcopy:=1;
mcopy im:=[MBook1]MSheet1!3 om:=[MBook1]MSheet2!3 fullcopy:=1;
mcopy im:=[MBook1]MSheet1!4 om:=[MBook1]MSheet2!4 fullcopy:=1;

as should this:

range raM = [MBook1]MSheet1;
loop(ii,1,raM.nmats) // nmats is the number of objects in a matrix sheet
{
mcopy im:=[MBook1]MSheet1!$(ii) om:=[MBook1]MSheet2!$(ii) fullcopy:=1;
}
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000