MATLAB Answers

## I am not getting the plot graph for this equation.

Asked by maharaj

### maharaj (view profile)

on 2 Apr 2013
Accepted Answer by Brian B

### Brian B (view profile)

s=A+((B*exp(-1.001*((x.^2) + 100)))/((x.^2) +100)) This is the equation I am working on I have x ranging from -20 to 20 in steps of 2 and I think the problem is with the constants being very small. A= 10^-10 B=10^-3

Graph is not being generated. Would someone help in generating the graph for this.

## 1 Answer

### Brian B (view profile)

Answer by Brian B

### Brian B (view profile)

on 2 Apr 2013
Edited by Brian B

### Brian B (view profile)

on 2 Apr 2013
Accepted answer

Presumably you want array division instead of a LS solution. Try

``` s=A+((B*exp(-1.001*((x.^2) + 100)))./((x.^2) +100))
%         Note the dot right here  ^```

That gives you a vector instead of a scalar. Plots of scalars tend to be rather boring. (The plot function does draw a single point, but it's often easy to miss.)

maharaj

### maharaj (view profile)

on 2 Apr 2013

Thank You sir.

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

### Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

### MATLAB Academy

New to MATLAB?

Learn MATLAB today!