フィルターのクリア

How to add line into an array

8 ビュー (過去 30 日間)
Ben van Zon
Ben van Zon 2022 年 11 月 2 日
コメント済み: Ben van Zon 2022 年 11 月 2 日
So I'm trying to verify a sensor using a nearby weatherstation's data.
But between the hours 10 and 15 there is no data, so it goes from 9, 10, 15, 16, etc.
How do I add the four zeroes necessary to make this graph fit according to my sensor data? Or how do I split it?
  1 件のコメント
Les Beckham
Les Beckham 2022 年 11 月 2 日
You need to be more specific about what isn't working for you. Please attach your data and post the code that isn't doing what you expect. Explain what you expect and how the actual results differ from what you expect.

サインインしてコメントする。

採用された回答

VBBV
VBBV 2022 年 11 月 2 日
編集済み: VBBV 2022 年 11 月 2 日
A = [1:10 , 15: 30];% your data
R = [A(1:10), zeros(1,4), A(11:end)]
  2 件のコメント
VBBV
VBBV 2022 年 11 月 2 日
Use concatenation operator
Ben van Zon
Ben van Zon 2022 年 11 月 2 日
Thank you this worked!
I had 60 hours logged so I had to change it to
U = [u(1:10), 11:14 , u(11:24), u(25:34), 11:14, u(35:48), u(49:58), 11:14, u(59:60)];
And it works now, thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTime Series Events についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by