Error using 'pi' too many input errors with my equation

2 Ansichten (letzte 30 Tage)
Serena Simpson
Serena Simpson am 18 Sep. 2020
Kommentiert: Serena Simpson am 18 Sep. 2020
%Defining given varibles
t = 0 :.1 :3;
f1 = 130;
f2 = 120;
y1 = cosd(2*pi*f1*t);
y2 = cosd(2*pi*f2*t);
%% Section 2: Processing
%equation given
y = 2 * cos(2*pi(f1+f2/2)*t) * cos(2*pi(f1-f2/2)*t);
%% Section 3: Result Output
plot(y)
title('Alternating Loud and Quiet Sounds')
xlabel('Time(s)')
ylabel('Amplitutde')

Akzeptierte Antwort

Steven Lord
Steven Lord am 18 Sep. 2020
You're missing * operators after the two calls to pi on the line where you define y, just like you did on the lines where you defined y1 and y2.

Weitere Antworten (0)

Kategorien

Mehr zu Audio I/O and Waveform Generation finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by