How to plot a function of multiple variables, where only 1 variable is unknown
4 次查看(过去 30 天)
显示 更早的评论
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.
回答(1 个)
Pooja Kumari
2023-9-7
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!