Error: Matrix dimensions must agree while using sin function

Ac=Am./m;% Amplitude of carrier signal [ where, modulation Index (m)=Am/Ac ]
fc=fa*100;% Frequency of carrier signal
Tc=1/fc;% Time period of carrier signal
yc=sin(2*pi*fc*t).*Ac;% Eqation of carrier signal
This is my code snippet. It shows the above stated error at the last line. Why is this error happening?
I just want the sin function to be multiplied with each element of Ac

回答 (1 件)

madhan ravi
madhan ravi 2020 年 6 月 22 日

0 投票

isequal(size(t),size(Ac)) % should return true

2 件のコメント

Deepon_Datta
Deepon_Datta 2020 年 6 月 22 日
I understand that the range of t and the size of Ac are mismatch. But I want to create and array with the different values of Ac as the amplitude of the sine waves. How to do that?
madhan ravi
madhan ravi 2020 年 6 月 22 日
doc linspace

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMatrices and Arrays についてさらに検索

タグ

質問済み:

2020 年 6 月 22 日

コメント済み:

2020 年 6 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by