Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5605 > unrolled thread
| Started by | Momo K <momok1994@googlemail.com> |
|---|---|
| First post | 2011-10-12 07:45 +0000 |
| Last post | 2011-10-13 07:53 +0000 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Plot function with two arguments Momo K <momok1994@googlemail.com> - 2011-10-12 07:45 +0000
Re: Plot function with two arguments Max Böhring <texuser@arcor.de> - 2011-10-13 07:48 +0000
Re: Plot function with two arguments David Skulsky <edskulsky@gmail.com> - 2011-10-13 07:53 +0000
| From | Momo K <momok1994@googlemail.com> |
|---|---|
| Date | 2011-10-12 07:45 +0000 |
| Subject | Plot function with two arguments |
| Message-ID | <j73gi1$ftj$1@smc.vnet.net> |
Hello,
I want to plot the function f. It is defined as followed:
f[x_, k_] := (k*x^2 - x)/(x - k)
As you see, it takes two arguments. In fact it shall represent a family of
curves, but I didn't find any way different to this to define one.
My aim is to plot the function by plot firstly f[x, -3], then f[x, -2], f[x,
-1], f[x, 0], ...
Is there a way to do this automatically without typing every single function
with k adjusted. I imagined something like {{x,-20,20}, {k,-3,3}} or so.
Many thanks
and best regards
Momo
[toc] | [next] | [standalone]
| From | Max Böhring <texuser@arcor.de> |
|---|---|
| Date | 2011-10-13 07:48 +0000 |
| Message-ID | <j76557$2ak$1@smc.vnet.net> |
| In reply to | #5605 |
On 2011-10-12 07:45:05 +0000, Momo K said:
> Hello,
>
> I want to plot the function f. It is defined as followed:
>
> f[x_, k_] := (k*x^2 - x)/(x - k)
>
> As you see, it takes two arguments. In fact it shall represent a family of
> curves, but I didn't find any way different to this to define one.
>
> My aim is to plot the function by plot firstly f[x, -3], then f[x, -2], f[x,
> -1], f[x, 0], ...
> Is there a way to do this automatically without typing every single function
> with k adjusted. I imagined something like {{x,-20,20}, {k,-3,3}} or so.
>
> Many thanks
> and best regards
>
> Momo
I'd suggest you have a look at the table command
[toc] | [prev] | [next] | [standalone]
| From | David Skulsky <edskulsky@gmail.com> |
|---|---|
| Date | 2011-10-13 07:53 +0000 |
| Message-ID | <j765cs$2d5$1@smc.vnet.net> |
| In reply to | #5605 |
You can use Table. For example:
Plot[Table[Sin[a x], {a, 1, 3}], {x, 0, 2 \[Pi]}]
David
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web