I wanna generate multiple carrier bt m getting error at line c(i,:)=.......
nos=4;
Tb=1;
fc=[10 30];
t=0:Tb/100:1;
A=5
for i=1:nos
c(i,:)=A*sin(2*pi*fc(i,:).*t);
end

 採用された回答

Star Strider
Star Strider 2016 年 3 月 21 日

0 投票

Replace your ‘fc’ assignment with:
fc = linspace(10, 30, nos);
so your code becomes:
nos=4;
Tb=1;
fc = linspace(10, 30, nos);
t=0:Tb/100:1;
A=5;
for i=1:nos
c(i,:)=A*sin(2*pi*fc(i)*t);
end
See if that does what you want.

2 件のコメント

sashish acharya
sashish acharya 2016 年 3 月 21 日
thnx for ur answer.But m not getting perfect sin wave. can u plz help again
Star Strider
Star Strider 2016 年 3 月 21 日
The sine waves are there. If you want them with better resolution, sample them more frequently, for example with:
t=0:Tb/500:1;

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

その他の回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 3 月 21 日
編集済み: Azzi Abdelmalek 2016 年 3 月 21 日

0 投票

There are many mistakes in your code
fc=[10 30];
the size of fc is [1 2], then fc(i,:) is not defined for i=2. also you are writing fc.*t, while fc and t have different sizes

3 件のコメント

sashish acharya
sashish acharya 2016 年 3 月 21 日
Sir can u plz provide correct program as an example.
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 3 月 21 日
It depends on what you want
sashish acharya
sashish acharya 2016 年 3 月 21 日
i want to generate 4 different carrier signal.

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

カテゴリ

製品

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by