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
 Addition of definite parts of two matrix
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Vertigo81

1 Posts

Posted - 05/04/2010 :  06:54:22 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello everybody

Following problem:

I have two big (100x100) matrix M1 and M2
and I want to add them, but not the whole ones,
only the columns 2..100 and the rows 3 to 100.

How can I do this?

Thank you

Sam Fang

293 Posts

Posted - 05/05/2010 :  04:30:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Currently we have to use Labtalk script to do it. Assume that two matrix objects M1, M2 are in [MBook1]MSheet1!. You can run the following script in the command window.

range M1=[MBook1]MSheet1!1;
range M2=[MBook1]MSheet1!2;
addsheet book:=MBook1 fname:=origin.otm oname:=sname;
range M3=[MBook1]sname$!1;
M3.nrows=98;
M3.ncols=99;
for(i=3; i<=100; i++)
  for(j=2; j<=100;j++)
    M3[i-2, j-1]=M1[i, j]+M2[i, j];

Added results are in the matrix object M3.

Sam
OriginLab Technical Services
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