Author |
Topic |
|
polimeros42
USA
Posts |
Posted - 12/06/2005 : 6:48:56 PM
|
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
|
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 |
|
|
polimeros42
USA
Posts |
Posted - 12/07/2005 : 10:34:35 AM
|
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 |
|
|
Mike Buess
USA
3037 Posts |
Posted - 12/07/2005 : 11:42:11 AM
|
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 |
|
|
polimeros42
USA
Posts |
Posted - 12/07/2005 : 6:45:53 PM
|
hello Mike, thank you very much, I downloaded the patch and now it works.. thanks Rebeca |
|
|
|
Topic |
|
|
|