How do I correctly enter the function sin^2 *(2*pi*f*t)?

33 views (last 30 days)
After I set t and f equal to a value how do u solve the function?
  2 Comments
Mukul Kumar
Mukul Kumar on 4 Aug 2020
You have to give a range of t values to plot this graph by this command t = initial value : incremental value : final value;
In other words by this command we have created a vector t that consists of all values between 0 to 10.

Sign in to comment.

Answers (5)

Walter Roberson
Walter Roberson on 3 Sep 2017
sin(2 .* pi .* f .* t) .^ 2
  2 Comments
Joshua Foster
Joshua Foster on 3 Sep 2017
Edited: Walter Roberson on 3 Sep 2017
Thanks! So is the next one plotted correctly?
X = 2.*sin(2.*pi.*f.*t).*cos(2.*pi.*f.*t)
?

Sign in to comment.


Jackie Adams
Jackie Adams on 27 Sep 2020
Plot(t, x)
  1 Comment
Walter Roberson
Walter Roberson on 27 Sep 2020
MATLAB is case sensitive now so Plot() would only be accepted on old versions of MATLAB. Exact dates are not coming to mind... I want to say since about r2006a.

Sign in to comment.


Thiri San
Thiri San on 2 Dec 2020
How to command in matlab? Pls solve my problem. Thank you
  3 Comments
Mukul Kumar
Mukul Kumar on 3 Dec 2020
N =[]; %initialising an array
for j = 1:n %loop to get n different values of x
x = 4*(cos((0.5*sqrt(-1)*pi)/(n+1)).^2);
N = [N x]; %appending values of x in initialised array
end
%Here, i have assumed set as an array of values.
%And we need to provide value of n too.
Walter Roberson
Walter Roberson on 3 Dec 2020
The x calculation here does not depend on the for loop variable j

Sign in to comment.


Ebrahim radman
Ebrahim radman on 17 Mar 2021
) Given a vector, t, of length n, write down the MATLAB expressions that will correctly compute the following:
a) ln(2 + t + t 2 )
b) e t (1 + sin(2t))
c) cos 2 (t) + sin 2 (t)
d) sec 2 (t) + cot(t)
- 1 - Test that your solution works for t = 1:0.5:4
- Plot the expressions -
Label the plotted figure with the following
o Title ( i.e.: Plot of ln(2 + t + t 2 ) )
o Axis
o Figure caption (your name and ID)
  4 Comments
Steven Lord
Steven Lord on 17 Mar 2021
As Walter stated this isn't an answer to the original question. In addition, this sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.

Sign in to comment.


Sheriff Ocran
Sheriff Ocran on 1 Apr 2021
(√z2+(xele −x2)/c how do i wirte this in matlab
  1 Comment
Walter Roberson
Walter Roberson on 1 Apr 2021
(sqrt(z2) + (xele - x2))/c
or possibly
(sqrt(z2 + (xele - x2)))/c
or possibly
sqrt(z2 + (xele - x2)/c)
depending on how far the square root is intended to extend.

Sign in to comment.

Categories

Find more on Graphics Objects 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!