How to use matlab comm.BPSKModulator system object ?

I am trying to simulate the following codes:
data = randi([0 1],100,1);
bpskModulator = comm.BPSKModulator;
bpskModulator.PhaseOffset = pi/16;
modData = bpskModulator(data);
scatterplot(modData)
but I am getting this error: Array formation and parentheses-style indexing with objects of class 'comm.BPSKModulator' is not allowed. Use objects of class 'comm.BPSKModulator' only as scalars or use a cell array.
Error in testerr (line 4) modData = bpskModulator(data);
Can someone help me please?

1 件のコメント

divya sai divya sai
divya sai divya sai 2020 年 10 月 28 日
data = randi([0 3],nframes*numData,numSym,numTxAnt);
modData = qpskMod(data(:));
modData = reshape(modData,nframes*numData,numSym,numTxAnt);
errorRate = comm.ErrorRate;
when i am trying to excute this i am getting Array formation and parentheses-style indexing with objects of class 'comm.QPSKModulator' is not allowed. Use objects of class 'comm.QPSKModulator' only as scalars or use a cell array.
i am getting error in 2nd line can someone assist me please.

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

 採用された回答

Walter Roberson
Walter Roberson 2016 年 12 月 23 日

1 投票

You are trying to use a syntax that is new in R2016b with an older MATLAB release. Use
modData = step(bpskModulator, data);

2 件のコメント

Arvin Seechurn
Arvin Seechurn 2016 年 12 月 23 日
Thank you.
Laid CHERGUI
Laid CHERGUI 2021 年 6 月 22 日
Thank you.

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by