While using the Live Editor, why does no output appear in the command window when I click the Run button?
Show older comments
Trying to calculate energy and power of continous time signal.
syms t;
s= input('Enter the signal: ');
s2=s^2;
l_lim = input('Enter the lower limit: ');
u_lim = input('Enter the upper limit: ');
F = inline(s2, 't');
energy=int(F(t),l_lim,u_lim);
if energy~=inf && energy~=-inf
disp ('the signal is an energy signal with energy equal to ' );
disp(energy);
end
power=limit((int(F(t),-t/2,t/2))/t,t,inf);
if power~=inf && power~=-inf
disp('the signal is a power signal with power equal to ');
disp(power);
end
2 Comments
Ameer Hamza
on 18 Oct 2020
In the live script, everything appears inside the script window. Why do you want to print it in the command window?
Walter Roberson
on 18 Oct 2020
What are some sample inputs?
Note that if energy and power are both infinite then you would not get any output.
F = inline(s2, 't');
Why are you using inline() ??? inline() has been recommended against since MATLAB 5.2.
Answers (0)
Categories
Find more on Function Creation 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!