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
 Forum for Python
 Concatenating matrices
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Alexa33000

France
1 Posts

Posted - 11/12/2025 :  1:20:01 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin):10.1.0.170
Operating System: Windows

Hi,
I am trying to interlace 2 matrices (1 column of matrix A, 1 column of matrix B, then 1 column of matrix A again, and so on.)

I am new to Python and not used to programming for Origin.

I have tried :
in Set values / Python function :

>>>>>>>>>
import OriginPro as op

def intensitephase(y,i,j):

"""
F:ii
"""

for i in range(1,257):
for j in range(1,514):
if round(j/2)==j/2 :
y=op.MBook4!cell(i,j/2)
else:
y=op.MBook1!cell(i,(j+1)/2)
return y

>>>>>

But that crashes, with a syntax error message.
It appears that I cannot call MBook4!cell(i,j/2) to get the value of a given cell.

How do I extract the value of a cell at row i, column j ?

Thank you

Alex'a.

YimingChen

1689 Posts

Posted - 11/14/2025 :  12:45:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please check this Python sample code:
https://www.originlab.com/doc/python/Examples/Origin-Python-Data-Exchange#Matrix_Data_Exchange

In Origin, one matrix sheet may have multiple matrix objects. you can use to_np3d() or to_np2d() method to extract data from all objects or one object.

Thank you
Yiming
Go to Top of Page
   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