Is it possible to obtain polynomial function (equation) or curve fit function from saved (plotted) dataset array?

조회 수: 3 (최근 30일)
Hello.
First of all, sorry if this question might sound simple and silly. This is my first attempt to involve this comunity. I'm new with Matlab, hence I appriciate a lot if someone able to guide me on this. Thank you.
As mentioned above, I have a set of data in array (voltage, time) from a simulink simulation. The data been log from a scope. I try to look into almost similar question of mine in this forum, however most of the answers provided are not for dataset array input. I try to use the suggested method with array type data and obviously its will be error. Here some on my code to give a brief idea on what I'm working on.
%% 1. For Volatge Measurement
n = 0;
MinRint = 0.00889;
figure('Name','Data Plot of Change of Internal Resistance over Voltage Measurement');
for n=1:30
filename = sprintf('dataCRLS_IntRes_%d.mat',n);
load(filename, 'data');
txt = [sprintf('%.5f Ohm',MinRint)];
plot(data(:,1), 'DisplayName',txt); % Here is my voltage data stored
title('Line Plot of Voltage and Discharge Time of Different Internal Resistance');
xlabel('Time (seconds)') ;
ylabel('Voltage (V)') ;
%% Here is my attempt to obtain the polynomial function.
p = polyfit(data(:,1));
hold on
MinRint = MinRint + IntResSamp;
end
  댓글 수: 5
Image Analyst
Image Analyst 2019년 3월 29일
Sayfiq, please attach dataCRLS_IntRes_1.mat and dataCRLS_IntRes_2.mat
Syafiq Anwar
Syafiq Anwar 2019년 3월 30일
편집: Syafiq Anwar 2019년 3월 30일
Here is the attachment per request Sir. Inside the file contains:
  • a - 3513x5 double type
  • crls - 1x1 dataset
  • data - 4501x5 double type
  • sample_IntRes - 30x1 double type
there is 5 column. The first one is voltage, current, power, SOC and temperature respectively.
Thank you.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Spline Postprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by