Author |
Topic  |
|
AKazak
Russia
1228 Posts |
Posted - 07/03/2021 : 08:08:31 AM
|
OriginPro 2021b (64-bit) SR2 9.8.5.212 Windows 10 21H1 x64
Greetings!
I want to rescale matrix Z values to a range [a,b]. As far as I understood, I should use Set Matrix Values... command. Is there a LT or OC function to remap [zmin,zmax] to [a,b]?
Thank you.
--- Andrey |
|
AmandaLu
439 Posts |
|
AKazak
Russia
1228 Posts |
Posted - 07/05/2021 : 03:11:09 AM
|
quote: Originally posted by AmandaLu
Hi,
Set Matrix Values is simpler way to rescale Z values. You can use msetvalue
https://www.originlab.com/doc/X-Function/ref/msetvalue
Thanks, Amanda OriginLab Technical Service
Do you mean doing something like this?
msetvalue im:=[MBook1]MSheet1!1 formula:="(Cell(i,j)-Zomin)/(Zomax-Zomin)*(Ztmax-Ztmin)+Ztmin" script:="Zomax=max(mat(1));Zomin=min(mat(1));Ztmax=10;Ztmin=20;"
--- Andrey |
 |
|
AmandaLu
439 Posts |
Posted - 07/05/2021 : 04:12:27 AM
|
yes
quote: Originally posted by AKazak
quote: Originally posted by AmandaLu
Hi,
Set Matrix Values is simpler way to rescale Z values. You can use msetvalue
https://www.originlab.com/doc/X-Function/ref/msetvalue
Thanks, Amanda OriginLab Technical Service
Do you mean doing something like this?
msetvalue im:=[MBook1]MSheet1!1 formula:="(Cell(i,j)-Zomin)/(Zomax-Zomin)*(Ztmax-Ztmin)+Ztmin" script:="Zomax=max(mat(1));Zomin=min(mat(1));Ztmax=10;Ztmin=20;"
--- Andrey
|
 |
|
AKazak
Russia
1228 Posts |
Posted - 07/05/2021 : 04:40:45 AM
|
quote: Originally posted by AmandaLu
yes
OK.
Is it OK to use the following syntax?
Zomax=max(mat(1));Zomin=min(mat(1));
Side question: why does the status bar doesn't show the statistics of the matrix selection (cells, rows, columns)? Also, Copy Statistics command also returns nothing?
--- Andrey |
 |
|
AmandaLu
439 Posts |
Posted - 07/05/2021 : 05:06:36 AM
|
Hi,
Yes, you can use the syntax.
quote: Originally posted by AKazak
Is it OK to use the following syntax?
Zomax=max(mat(1));Zomin=min(mat(1));
Matrix doesn’t support status bar yet.
quote: Originally posted by AKazak
Side question: why does the status bar doesn't show the statistics of the matrix selection (cells, rows, columns)? Also, Copy Statistics command also returns nothing?
BTW, I just found we have a sample of normalizing matrix. You can modify the code as needed.

Thanks, Amanda OriginLab Technical Service
|
 |
|
AKazak
Russia
1228 Posts |
Posted - 07/05/2021 : 06:02:37 AM
|
quote: Originally posted by AmandaLu
Hi,
Yes, you can use the syntax.
quote: Originally posted by AKazak
Is it OK to use the following syntax?
Zomax=max(mat(1));Zomin=min(mat(1));
Matrix doesn’t support status bar yet.
quote: Originally posted by AKazak
Side question: why does the status bar doesn't show the statistics of the matrix selection (cells, rows, columns)? Also, Copy Statistics command also returns nothing?
BTW, I just found we have a sample of normalizing matrix. You can modify the code as needed.

Thanks, Amanda OriginLab Technical Service
Got it, thanks! Please add my vote for the Status Bar Statistics, while working with matrices.
--- Andrey |
 |
|
cpyang
USA
1406 Posts |
Posted - 07/05/2021 : 11:59:05 AM
|
Status bar stats was in our plan for 2022, ORG-23121
CP
|
 |
|
|
Topic  |
|
|
|