how to use zeros command to construct a new sequence?

just wondering how to use zeros command to construct a new sequence y[n] by padding M zeros at the end of x[n]=10cos(0.2*pi*n+1.2) where n is between 0 and 100 (including 0 and 100).
t = 0:0.001:0.1-0.001;
x = 10*cos(200*pi*t+1.2);
but how to append M zeros? Thank you!

 採用された回答

Pedro Villena
Pedro Villena 2012 年 10 月 24 日
編集済み: Pedro Villena 2012 年 10 月 24 日

0 投票

n=0:100; %->N=101
T=0.001; %period [s]
t=(0:T:T*n(end));
x=10*cos(0.2*pi*n+1.2);
where x(1) represent x(n=0), and x(100) represent x(n=101)
M = 1000000; %number of zeros
y = [x zeros(1,M)];
tt =(0:T:T*length(y)-1);

2 件のコメント

modified covariance
modified covariance 2012 年 10 月 24 日
thx for ur answer. but i am just wondering if M is now 1000000, how can i substitute 1000000 zeros into ur code?
modified covariance
modified covariance 2012 年 10 月 24 日
thank u for helping me a lot.

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

その他の回答 (0 件)

カテゴリ

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

製品

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by