フィルターのクリア

Sample of sine wave

6 ビュー (過去 30 日間)
Rakesh Jain
Rakesh Jain 2018 年 2 月 14 日
回答済み: MathWorks Support Team 2022 年 4 月 13 日
I need to sample a continuous time sine wave via MATLAB. For example, I need 19 samples of a sine wave. But the output, i.e. the sample data I need in a text file, so that I can use it in my FPGA software. How shall I do it?

採用された回答

Jos (10584)
Jos (10584) 2018 年 2 月 15 日
Something along these lines?
t = linspace(0,2*pi,1000) ;
y = 100 * sin(2*pi*1.8*t) ;
s = sort(randperm(numel(t),19)) ; % 19 random points, sorted
plot(t,y,'b.-', t(s), y(s),'ro') ; % check
data = [t(s) ; y(s)].'
dlmwrite('export.txt',data)

その他の回答 (1 件)

MathWorks Support Team
MathWorks Support Team 2022 年 4 月 13 日
In addition to the Answer above, please see the following page for how to generate HDL code from MATLAB code and deploy to an FPGA: https://www.mathworks.com/help/hdlcoder/targeting-fpga-amp-soc-hardware.html

カテゴリ

Help Center および File ExchangeCode Generation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by