Group Abstract Group Abstract

Message Boards Message Boards

0
|
9.8K Views
|
4 Replies
|
1 Total Like
View groups...
Share
Share this post:

Define parameters accurately in custom functions?

Posted 6 years ago
POSTED BY: Christian Stotz
4 Replies

Hey, Christian, how are you?

You can do

f[a_Integer,x_Real]:=a*x^2

so, when you use manipulate, you will be able to run the following code

Manipulate[Plot[f[a,x],{x,-5,5}],{a,1,50,1}]

enter image description here

POSTED BY: Estevao Teixeira

Hello Estevao,

thank you so much for helping!

POSTED BY: Christian Stotz

Hello Estevao,

Thank you so much for your reply! It works perfectly, however, do you also have a solution where I can define the parameter globally? In a way, that I can define a as an integer and use this to define several functions? Or do I have to enter every time I use the parameter that this is an integer?

Thank you so much!

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