I am not getting the plot graph for this equation.

조회 수: 2 (최근 30일)
maharaj
maharaj 2013년 4월 2일
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.

채택된 답변

Brian B
Brian B 2013년 4월 2일
편집: Brian B 2013년 4월 2일
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.)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by