Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.5K Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How do I use correctly use curly brackets in wolfram for multi-functions?

Posted 11 years ago
POSTED BY: Symond Hendricks
4 Replies

x_ means that x is an undetermined variable. You need to look at the Mathematica documentation http://reference.wolfram.com/language/

POSTED BY: S M Blinder

You can also use

f[x_] := Which[x < 2, 2 x + 1, x > 2, x^2]

although this leaves f[2] undefined

POSTED BY: S M Blinder

Can you elaborate? Your formula looks alot better than the messy piecewise code. I'd like to use it!

What do you mean by the _ in f[x_]? and when I write it out do I also write ":= Which"

What would be another random example (doesn't have to be a real equation) for say a piecewise function with THREE different functions?

POSTED BY: Symond Hendricks
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard