How to create a time series dataset for prediction of load demand using matlab

I want to create a time series dataset to tain my ML model which should has resistance load, inductive load, capasitive load and power factor.

回答 (1 件)

Manas
Manas 2023 年 6 月 16 日
Hi Aakanksh,
you can use the following code for reference to build you dataset
% Define time interval and duration
timeInterval = seconds(1); % Time resolution of 1 second
duration = hours(1); % Duration of 1 hour
% Generate time stamps
timeStamps = (datetime('now'):timeInterval:(datetime('now')+duration))';
% Preallocate arrays for data
numSamples = numel(timeStamps);
loadResistance = zeros(numSamples, 1);
inductiveResistance = zeros(numSamples, 1);
capacitiveResistance = zeros(numSamples, 1);
powerFactor = zeros(numSamples, 1);
% Generate random or simulated values for each time stamp
for i = 1:numSamples
% Generate random values for load resistance, inductive resistance, capacitive resistance, and power factor
loadResistance(i) = rand(); % Modify with appropriate range or distribution
inductiveResistance(i) = rand(); % Modify with appropriate range or distribution
capacitiveResistance(i) = rand(); % Modify with appropriate range or distribution
powerFactor(i) = rand(); % Modify with appropriate range or distribution
end
% Create a table to store the data
data = table(timeStamps, loadResistance, inductiveResistance, capacitiveResistance, powerFactor);
% Save the data to a CSV file
writetable(data, 'time_series_dataset.csv');
You can refer to the following documentation for more info:

1 件のコメント

Aakanksh Gowda
Aakanksh Gowda 2023 年 6 月 16 日
I have tried this before but it will generate random data. What i wanted is more complicated. I wanted the dataset to maintain its relation for resistive, inductive and capacitive load

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

カテゴリ

ヘルプ センター および File ExchangeECG / EKG についてさらに検索

製品

リリース

R2022b

質問済み:

2023 年 6 月 16 日

編集済み:

2023 年 6 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by