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
 matrix operations
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

polimeros42

USA
Posts

Posted - 12/06/2005 :  6:48:56 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 6.0
Operating System:windows
hello!!
I have a 1024*1024 matrix and I want to divide it by the values in the column (i,1024). I have tried Matrix1=Matrix1/cell(i,1024) and it does not work.
Thank you very much
Rebeca

Mike Buess

USA
3037 Posts

Posted - 12/06/2005 :  9:35:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The cell() function was introduced in Origin 6.0 but not documented until Origin 6.1. Its syntax also changed from one version to the next...

cell(i,j) = value at col i, row j; // Origin 6.0
cell(i,j) = value at row i, col j; // Origin 6.1 and later

In your version Matrix1=Matrix1/cell(i,1024) divides the entire matrix by the value in col i, row 1024. If you want to divide the matrix by the value in row i, col 1024 just interchange the cell() arguments.

Mike Buess
Origin WebRing Member
Go to Top of Page

polimeros42

USA
Posts

Posted - 12/07/2005 :  10:34:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thank you Mike, but it does not work, I have introduced Matrix1=Matrix1/cell(1024,j)and the data are cut, is there any way to do it in a worksheet?
thank you very much for your help
Rebeca
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 12/07/2005 :  11:42:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Rebeca,

I still have the latest version of Origin 6.0 on my PC and it works in that version. I recommend that you apply the Origin 6.0 Service Release 4 Patch. If you can't do that then you can duplicate the cell() function as shown below. (The string variable %H always holds the name of the active window.)

rr = enter row number;
cc = enter column number;
win -a Matrix1; // activate Matrix1
matrix -pg Dim ncols nrows; // get number of columns and rows
if(rr<=nrows && cc<=ncols) {
cellValue = %H[cc + (rr-1)*ncols]; // get value at row rr, col cc
(%H) /= cellValue; // divide matrix by cellValue
};

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 12/07/2005 11:49:50 AM
Go to Top of Page

polimeros42

USA
Posts

Posted - 12/07/2005 :  6:45:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hello Mike,
thank you very much, I downloaded the patch and now it works..
thanks
Rebeca
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