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
 Min/Max function from script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

yt47106

Sweden
Posts

Posted - 08/17/2011 :  06:37:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.5 SR1
Operating System: winXP

Hi,

probably very basic but anyway:
the max- and min-functions doesn´t seem to work when running from script window (nor as an advanced filter script), it only produce following message:
"incorrect number of arguments passed to function: Min"
When executing as a "Set Column Value"-formula it works perfectly well.
Is there a way to rewrite the min/max-function to get it work as a script?

regards Bjorn

Hideo Fujii

USA
1582 Posts

Posted - 08/17/2011 :  10:31:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Bjorn,

As you didn't describe what you fed to the Min function as the arguments, it is not clear what happened. But, as described in the LabTalk help, Min/Max/Mean function takes a vector (column, range, matrix, list...) as its argument. For example, the all following codes work:
  mymin=min(col(B));

  range myrange=[Book1]Sheet1!col(2)[1:10];
  myrngmin=min(myrange);

  mymatmin=min(MBook1);

  mylistmin=min(8, 3, 2, 6, 6);
Maybe you can post your snippet here?

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 08/17/2011 10:33:51 AM
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