changing existing hourly data figure to average daily figure

2 ビュー (過去 30 日間)
Muhammad Naseer
Muhammad Naseer 2020 年 3 月 12 日
コメント済み: Image Analyst 2020 年 3 月 15 日
Hi, I have plot which is based on houlry data with five data sets. what I need is to convert that figure in average daily data or figure from the existing matlab figure is it possible?

回答 (1 件)

Piyush Lakhani
Piyush Lakhani 2020 年 3 月 12 日
編集済み: Piyush Lakhani 2020 年 3 月 12 日
Hi Muhammad,
using 'findobj' function you may got the data points and replot after calculating the mean.
Following is solution that may work fine for you.
open('vent_new.fig')
h = findobj(gca,'Type','line');
x=get(h,'Xdata');
y=get(h,'Ydata');
x=cell2mat(x);
y=cell2mat(y);
y_mean=mean(y);
plot(x(1,:),y_mean)
  3 件のコメント
Piyush Lakhani
Piyush Lakhani 2020 年 3 月 15 日
Plot command gives line. What i had attached is not bar graph. But, its looks like too fluctuating data points.
Image Analyst
Image Analyst 2020 年 3 月 15 日
You should use the original data that was used in crating the figure in the first place. Muhammad, can you attach your script and data? I don't want the .fig file, but the code for how to create the .fig file.

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

カテゴリ

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

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by