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
 Origin Forum
 Scaling matrix values to a range [a,b]

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
AKazak 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
7   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 07/05/2021 : 11:59:05 AM
Status bar stats was in our plan for 2022, ORG-23121

CP
AKazak 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
AmandaLu 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 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 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 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 Posted - 07/04/2021 : 11:40:51 PM
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

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