I have some problem when plotting the graph, anyone can help? Thanks
1 view (last 30 days)
Show older comments
Erwin Koman
on 27 Jun 2015
Commented: Erwin Koman
on 27 Jun 2015
This is my code
for x = -10:10
y = 2^(0.4*x)+5
plot(x,y,'g')
end
0 Comments
Accepted Answer
Salaheddin Hosseinzadeh
on 27 Jun 2015
Edited: Salaheddin Hosseinzadeh
on 27 Jun 2015
Hi,
You need to store y first.
x = -10:10;
for i = 1:numel(x)
y(i) = 2^(0.4*x(i))+5
end
plot(x,y,'g')
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!