generate 100-element row in matlab
4 ビュー (過去 30 日間)
古いコメントを表示
Hello,
Can anyone help me with generating this signal s(n)=cos(0.04*pi*n) with 100 element row in matlab
採用された回答
Pratyush Swain
2022 年 6 月 30 日
Hey,
I believe you need to store the values of the function in a vector of 100 elements;
%create evenly spaced input values%
n=linspace(0,50,100);
%s is the vector which shall contain the output values%
s=zeros(1,100);
%calculate and store function values%
for i=1:length(n)
s(i)=cos(0.04*pi*n(i));
end
%plot to realise them%
figure;
plot(n,s);
Hope this helps.
1 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Waveform Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!