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
 Origin Forum
 Matrices manipulation (adding)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

RafalM

6 Posts

Posted - 06/07/2011 :  08:37:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.: OriginPro 8.0.63.988 SR6 v8.0988;
Operating System: Windows XP

I have 100 matrix data sets which I need to add. Is there some automatic function that would do it, as opposed to adding them manually one by one?

Thanks in advance,
Rafal

Hideo Fujii

USA
1582 Posts

Posted - 06/07/2011 :  12:52:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Rafal,

The following snippet add all existing matrices to a new destination matrix. Here, it assumes all matrices have the same size, and a matrix book contains only one sheet:

/////////////////
string mm$, hh$;
window -d; //duplicate to make same size matrix
%M=%H; //destination mat name
mm$=%M; //same
(%M)=(0); //initialize
%K=""; //formula string
doc -e M {
   hh$=%H; //picked-up matrix
   if(hh$!=mm$) { //exclude destination
    %K=%M+%H; //concat a term to formula
    (%M)=(%K); //evaluation the formula
   }
}
/////////////////

You can run this script by pasting in Script window, highlight all lines, and press ENTER key. Please modify as needed.

--Hideo Fujii
OriginLab
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