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
 All Forums
 Origin Forum for Programming
 Forum for Python
 Concatenating matrices

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Alexa33000 Posted - 11/12/2025 : 1:20:01 PM
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.
1   L A T E S T    R E P L I E S    (Newest First)
YimingChen Posted - 11/14/2025 : 12:45:17 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000