Convert Data from array
古いコメントを表示
Hi
I have attached a Jpeg of my data file displayed in a plot,(0 to 80mS) it shows exactly the data I need how do I convert this data to a new array as is in the plot. The actual array use to create the plot has 16000 samples at 5uS per sample which is of no interest .I just need the 1s and 0s as the plot along with there timing and not 16000 1s and 0s
Thank you for any help
David
採用された回答
その他の回答 (1 件)
Ameer Hamza
2020 年 9 月 22 日
0 投票
It seems that you want to reduce the number of samples. For your data, a good option seems to be decimate(): https://www.mathworks.com/help/signal/ref/decimate.html
5 件のコメント
David Jones
2020 年 9 月 22 日
Ameer Hamza
2020 年 9 月 22 日
Can you share the data in a .mat file?
David Jones
2020 年 9 月 22 日
Ameer Hamza
2020 年 9 月 22 日
Check this code. It just keeps one value of 1s and 0s for each consecutive sequence along with the corresponding time
load Data.mat
n = numel(sqwvx);
Ts = 5e-6;
t = 0:Ts:(n-1)*Ts;
idx = find(diff(sqwvx));
t_new = t(idx);
sqwvx_new = sqwvx(idx);
David Jones
2020 年 9 月 23 日
カテゴリ
ヘルプ センター および File Exchange で Data Type Identification についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!