フィルターのクリア

How can i add data from multiple tables?

5 ビュー (過去 30 日間)
Oscar Rogneby
Oscar Rogneby 2021 年 3 月 6 日
回答済み: Aashita Dutta 2022 年 1 月 25 日
I have a data set of six tables containing energy production.
They contain 2 rows and different number of columns.
Row 1 contains dates with different starting points, row 2 contains production values.
I have imported 6 tables, and added the range command to align the dates, as they have the same ending point.
They look like this.
V = readtable('Valsneset2006.xlsx','Range','A4:B4783');
S = readtable('Skomakerfjellet2016.xlsx','Range','A4:B4783');
The S matrix has over 3000 empty cells before it lines up with V, but i can't seem to find a better way to aling them.
I want to add the production numbers in row 2 of the different tables to view the total energy production each day.
How can i achieve this?
Thanks in advance!
  1 件のコメント
dpb
dpb 2021 年 3 月 6 日
編集済み: dpb 2021 年 3 月 6 日
See <timetable.synchronize>. Also look at the "See Also" section for more on the general problem of cleaning up time series data. In short, don't try to physically align the data by location by hand; read in the data available and work on it in memory with the tools provided by MATLAB.

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

回答 (1 件)

Aashita Dutta
Aashita Dutta 2022 年 1 月 25 日
As per my understanding, you are trying to read multiple tables and unable to align these tables due to empty cells in the matrix.
There are a couple of ways to resolve this issue. You can use the rmmissing’ function in Matlab that removes missing entries from the table.
T = readtable('Skomakerfjellet2016.xlsx','Range','A4:B4783');
T1 = rmmissing(T);
You can also use detectImportOptions function that create import options based on file content with MissingRuleproperty to manage missing data.
opts = detectImportOptions(' Skomakerfjellet2016.xlsx ');
opts.MissingRule = 'omitrow';

カテゴリ

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

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by