フィルターのクリア

How to plot a vector for fixed intervals

2 ビュー (過去 30 日間)
Davide Cannavacciuolo
Davide Cannavacciuolo 2023 年 11 月 28 日
編集済み: chicken vector 2023 年 11 月 28 日
Hello, I have a vector of times for example [t1 t2 t3 t4]. I also have a vector of values A=[a1 a2 a3 ] .I need to plot between t1 and t2 the constant value a1, between t2 and t3 the value a2, between t4 and t3 the value a3. How can I do it?

採用された回答

chicken vector
chicken vector 2023 年 11 月 28 日
編集済み: chicken vector 2023 年 11 月 28 日
Something like this?
t = [1 3 4 7];
a = [5 3 9 4];
stairs(t,a);
grid on;
xlim([0,10]);
ylim([0,10]);
xticks(1:10);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by