how do i write an algorithm
Show older comments
Develop M-file that can do followings
- Ask you to input the functions f1(x)=x.^2; f2(x)=x.^3; where x is -100, -99, -98........, 99, 100
- Find and plot fsum(x)=f1(x)+f2(x)
What i could come up with
ni=0
nf=100
for x=ni+nf;
f1(ni)=ni^2;
f2(nf)=nf^3;
fsum(x)=f1(ni)+f2(nf);
end
plot(fsum);
Accepted Answer
More Answers (1)
Antwone Goodwyn
on 6 May 2019
0 votes
Categories
Find more on Programming 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!