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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spline Postprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!