Is it possible to obtain polynomial function (equation) or curve fit function from saved (plotted) dataset array?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Image Analyst
el 29 de Mzo. de 2019
Sayfiq, please attach dataCRLS_IntRes_1.mat and dataCRLS_IntRes_2.mat
Respuestas (0)
Ver también
Categorías
Más información sobre Polynomials en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!