Message Boards Message Boards

0
|
5212 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

use my function

Posted 10 years ago

Hi. I dont; understand how use if conditionals in wolfram. If NeedOtsu is true I should use Binirize, If NeedOtsu is false I should use my function. I tryed to use this but there is Error: Tag Binarize in Binarize[]/;True is Protected. >> What is wrong?

POSTED BY: Dmitry Dmitriev
2 Replies

Hello Dmitry,

At the risk of proposing the obvious, have you tried:

myProcedure[something_]:=If[NeedOtsu,Binarize[something],myFunction[something]]

?

OL.

POSTED BY: Otto Linsuain

It depends on what syntax you are using. You can try something like this:

myProcedure /; NeedOtsu := Binarize[something];
myProcedure /; Not[NeedOtsu] := myFunction[something]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract