HOW to write cos^2(t) in matlap

805 views (last 30 days)
HOW to write cos^2(t) in matlap

Accepted Answer

madhan ravi
madhan ravi on 18 Jun 2020
Edited: madhan ravi on 18 Jun 2020
t = 0:pi:2*pi;
cos(t).^2 % basic question , start with MATLAB Onramp course

More Answers (2)

Brigid Welch
Brigid Welch on 19 Jan 2022
how to write cos(t)^2
  1 Comment
Walter Roberson
Walter Roberson on 19 Jan 2022
If t is a scalar, then exactly like you wrote will work, cos(t)^2
If t is a vector or array, you will likely need cos(t).^2

Sign in to comment.


Soledad Rodriguez
Soledad Rodriguez on 1 Apr 2022
yb = cos^2 (5x) / x^2
  2 Comments
Walter Roberson
Walter Roberson on 1 Apr 2022
Also cos(5*x).^2./x.^2 and (cos(5*x)./x).^2

Sign in to comment.

Categories

Find more on Creating and Concatenating Matrices 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!