How to plot a function of multiple variables, where only 1 variable is unknown
4 views (last 30 days)
Show older comments
Hello,
I am trying to look into hilbert transforms for my class. I am fairly new to matlab so I am experiencing some trouble trying to plot these functions.
Below is some code for a raisedCosine sqrt funciton (IIR) and I am trying to plot this as a function of t with specified values of tau, T_b, and alpha. When I run this code I get the picture below, which is essentially nothing. Am I coding this correctly? I was not able to find alot of support on this exact question.
3 Comments
Answers (1)
Pooja Kumari
on 7 Sep 2023
Dear GRANT,
I understand that you are facing issues when plotting the raisedCosine square root function (IIR) as a function of 't', using specified values of 'tau', 'T_b', and 'alpha'. Instead of creating a separate function to obtain the output of the raisedCosine square root function, you can directly store the output in a variable called 'rc_sq_t'. I have provided a sample code below for reference:
% Define the symbolic variable
syms t
tau =0.3e-6;
T_b = 1e-6;
alpha = 0.25;
% Define the function
rc_sq_t = (1/sqrt(T_b))*((sin((1-alpha)*(pi*t/T_b))+(4*alpha*t/T_b)*(cos((1+alpha)*pi*t/T_b)))/((pi*t/T_b)*(1-(4*alpha*t/T_b)^2)));
% Plot the function
fplot(rc_sq_t,[-100,100])
You can refer to the below documentation for more information on "fplot" function:
I hope this helps!
0 Comments
See Also
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!