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

조회 수: 10(최근 30일)
%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
title('Alternating Loud and Quiet Sounds')
  댓글 수: 1
Serena Simpson
Serena Simpson 2020년 9월 18일
The problem is with my 'y' equation

댓글을 달려면 로그인하십시오.

채택된 답변

Steven Lord
Steven Lord 2020년 9월 18일
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.
  댓글 수: 1
Serena Simpson
Serena Simpson 2020년 9월 18일
Oh. I see now. Thank you so much!!

댓글을 달려면 로그인하십시오.

추가 답변(0개)


Community Treasure Hunt

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

Start Hunting!

Translated by