how to type this equation in matlab?

2 views (last 30 days)
waruna muththettupita
waruna muththettupita on 4 Oct 2021
Answered: Steven Lord on 4 Oct 2021
how can i write 30sin(7/(10t^2))-2t in matlab?

Answers (1)

Steven Lord
Steven Lord on 4 Oct 2021
Much as you'd written it here, except for the fact that if you multiply a number and a variable, two variables, or a number or variable and the output of a function you must include the multiplication symbol * between the quantities you want to multiply. So "y = 2x" will not work. "y = x2" will not multiply x by 2 but will refer to a variable named x2. "y = 2*x" or "y = x*2" will make the elements of y double the corresponding elements of x.
There is one additional point you should consider, and that's whether you want to be able to evaluate this expression for scalars or for arrays. See this documentation page for more information on the difference between array operations and matrix operations.

Categories

Find more on Get Started with MATLAB 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!