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
 Subtracting value from all cells of a matrix/sheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Sommerfeld

Germany
3 Posts

Posted - 11/07/2020 :  3:53:14 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin 2018 64 bit
Operating System: Windows 10

Dear all,

I would like to subtract the minimum value of a matrix from every cell.
I am not familiar with the command window and only found that "min(Matrixname)=" gives the minimum value as an output. Could somebody help me out with the correct syntax for the subtraction?

Besides could you tell me where I could find a good starting point to learn the available command syntax?

Best Regards

cpyang

USA
1406 Posts

Posted - 11/08/2020 :  10:47:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
In LabTalk, %C is the active dataset, and a matrix can be calculated like a dataset, so the following will work

%C-=min(%C)


Alternatively, you use the name of the matrix book, like
MBook1 -= min(MBook1)



Here would be a good starting point for LabTalk

https://d2mvzyuse3lwjc.cloudfront.net/doc/LabTalk/guide/Getting-Started-with-LT


CP
Go to Top of Page

Sommerfeld

Germany
3 Posts

Posted - 11/09/2020 :  07:27:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks very much for your answer. When I tried using
quote:
Originally posted by cpyang

%C-=min(%C)

MBook1 -= min(MBook1)




the vlaues of the matrix remained unchanged without any
error message.

Edited by - Sommerfeld on 11/09/2020 10:56:53 AM
Go to Top of Page

Chris D

428 Posts

Posted - 11/09/2020 :  10:36:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Any chance that the matrix values were generated by some sort of operation and they are locked by a lock icon?

If so, you can't change their values as outlined.

You'd have to set the recalculation to None via the lock icon.

Then CP's suggestions would work.



Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

Sommerfeld

Germany
3 Posts

Posted - 11/09/2020 :  10:56:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes that solves the problem, the matrix was created from a sheet and therefore had the mentioned lock icon.
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