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:
640 x 480
800 x 600
1024 x 768
1280 x 1024
UserName:
Password:
Anti-Spam Code:
Format Mode:
Basic
Help
Prompt
Format:
Font
Andale Mono
Arial
Arial Black
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Georgia
Impact
Lucida Console
Script MT Bold
Stencil
Tahoma
Times New Roman
Trebuchet MS
Verdana
Size
1
2
3
4
5
6
Color
Black
Red
Yellow
Pink
Green
Orange
Purple
Blue
Beige
Brown
Teal
Navy
Maroon
LimeGreen
Message:
* HTML is OFF
*
Forum Code
is ON
Smilies
[quote][i]Originally posted by Alexa33000[/i] [br]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. [/quote]
Check here to include your profile signature.
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
Snitz Forums 2000