MATLAB Answers

Element by Element Multiplication?

6 views (last 30 days)
Currently I have this.
x = [1, .1, .01, .001, .0001, .00001, .000001, .0000001, .00000001, .000000001, .0000000001, .00000000001];
f = 0;
e = 2.71828;
for i = 1:length(x);
f = (e.^(x).*sin(x)/x).^2
end
Now I want it to display f for every single value of X, not just the end result. What am I doing wrong?

  0 Comments

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 5 Apr 2013
Use ./ instead of /

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.