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
 Origin Forum
 Scaling matrix values to a range [a,b]
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AKazak

Russia
1228 Posts

Posted - 07/03/2021 :  08:08:31 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Posted - 07/04/2021 :  11:40:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

AKazak

Russia
1228 Posts

Posted - 07/05/2021 :  03:11:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

AmandaLu

439 Posts

Posted - 07/05/2021 :  04:12:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Go to Top of Page

AKazak

Russia
1228 Posts

Posted - 07/05/2021 :  04:40:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

AmandaLu

439 Posts

Posted - 07/05/2021 :  05:06:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

AKazak

Russia
1228 Posts

Posted - 07/05/2021 :  06:02:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 07/05/2021 :  11:59:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Status bar stats was in our plan for 2022, ORG-23121

CP
Go to Top of Page
  Previous Topic 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