Re: something wrong with my code??

• To: mathgroup at smc.vnet.net
• Subject: [mg129580] Re: something wrong with my code??
• From: christopher arthur <chris.arthur1 at gmail.com>
• Date: Sat, 26 Jan 2013 01:39:15 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-newout@smc.vnet.net
• Delivered-to: mathgroup-newsend@smc.vnet.net
• References: <20130125063513.1C82068D6@smc.vnet.net>

```Change this:

data = Table[if[[f[x], {x, -5, 5, 0.01}] > 0.005, 0.005, f[x]]];

to this:

data = Table[if[f[x] > 0.005, 0.005, f[x]],{x, -5, 5, 0.01}];

chris arthur

sylphid707 a écrit :
> First of all, this might give seasoned Mathematica users some serious eye sores cause I'm a newb at this xD
>
> f[x_] := (1^-9) (Exp[38.629 x] - 1);
> data = Table[if[[f[x], {x, -5, 5, 0.01}] > 0.005, 0.005, f[x]]];
> ListPlot [data, DataRange -> {-5, 5}, Joined -> True,
>  PlotRange -> {0, 0.01}, PlotStyle -> {Thickness[0.005]}]
>
>
> What I want to do this is do a plot of a sweep from -5 to 5 with 0.01 stepsize, and if the output value exceeds 0.005, the output value will just be 0.005. It will kind of look like a heavyside step function/unit step function.
> Any help would be greatly appreciated xD.
>
>
>

```

• Prev by Date: Re: Mathematica and Lisp
• Next by Date: Help. Fitting 2 dimensional lists with a parametric differential
• Previous by thread: something wrong with my code??
• Next by thread: Re: something wrong with my code??