Is it possible to obtain polynomial function (equation) or curve fit function from saved (plotted) dataset array?
1 次查看(过去 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!