plot not displaying figure

1 ビュー (過去 30 日間)
Ram Basnet
Ram Basnet 2021 年 5 月 1 日
i have table which has datetime and sub_metering_1 as two variables on table. I wrote code to plot the figure but it is not showing
if (data_useful.DateTime.Hour==8)
plot(DateTime, Sub_metering_1)
  2 件のコメント
Ram Basnet
Ram Basnet 2021 年 5 月 2 日
if any(isa)
meter_readings_cluster_few = data1.Sub_metering_1;
dates_table_few= data1.DateTime
plot(dates_table_few, meter_readings_cluster_few)


回答 (1 件)

Saravanakumar Chandrasekaran
Saravanakumar Chandrasekaran 2021 年 5 月 2 日
You are trying to a logical check for data_useful.DateTime.Hour==8. so at all times it is getting failed.
in the suggestion provided by dpb, you have wrongly included ==
i.e., the line should be
isa = (data1.DateTime.Hour==8)
i hope if u correct the above line ,it will work.

Community Treasure Hunt

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

Start Hunting!

Translated by