Output equation answer from 1 to 50
Show older comments
This is probably a very simple question, but I have an equation that I need to have the output printed out from 1 to 50 by increments of 1, so I was just wondering how this would be done.
1 Comment
Housam
on 12 Mar 2021
Answers (1)
David Hill
on 12 Mar 2021
f=@(x)x.^2.*sin(x)-x.*cos(x);%any equation of one variable
f(1:50)%prints to command window with no ;
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!