How can I increase my output frequency

1 回表示 (過去 30 日間)
Fontys
Fontys 2013 年 5 月 8 日
回答済み: CHAO Zheng 2021 年 5 月 13 日
Hi, For a school project I need to send out a series of pulses on a high frequency. The problem is that I need code to be executed between every pulse.
For now I found this code:
%Initialise digital channel s (output) and m (input) and array a
For i = 1:n
s.outputSingleScan(1)
s.outputSingleScan(0)
a(i)=m.inputSingleScan()
end
The problem with this method is that the signal only works whith a frequency of 38 Hz (the for loop is executed only 38 times a second). I need it to be at at least 1kHz.
Is there a way that I can speed up the code? Or is there a way that this can be done faster?
Thanks in advance.

回答 (2 件)

David Sanchez
David Sanchez 2013 年 5 月 8 日
Sometimes it is not just a matter of coding, but the machine you use to perform the operation. Anyway, check out the following links, they might help:

CHAO Zheng
CHAO Zheng 2021 年 5 月 13 日
hi,have you solved this problem?The execution time of two lines of code has been more than 60 ms, and I am very painful.It is impossible to realize high frequency pulse.

カテゴリ

Help Center および File ExchangePulse and Transition Metrics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by