How to generate a square wave with integer values and fixed timespan?
古いコメントを表示
I want to generate a square wave with integer values between 0 and 5 in a timespan of 30ms.
An example:
[1 1 1 1 2 2 2 4 4 4 4 4 5 5 5 5 5 5 5 5 5 0 0 0 0 0 0 0 2 2 2 2 3 3 3 ]
I've tried different things but I can't seem to find an effective way.
2 件のコメント
David Goodmanson
2021 年 4 月 6 日
Hi Samuele, see the 'square' function.
Adam Danz
2021 年 4 月 6 日
If those are the y-values, what are the corresponding x values?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

