Obtaining the equation from the graph that plotted

82 visualizaciones (últimos 30 días)
Siti Fatimah Mohamed Hisham
Siti Fatimah Mohamed Hisham el 2 de Abr. de 2019
Hello. I am currently using MATLAB to obtain the equation of the graphs from oscilloscope. The data that I used to plot the graph was obtained from the oscilloscope, so the graph is quite unique.
n.JPG
As you can see from the picture, there are two datas. Hence, I need to obtain two different equations. Please show me how it's possible.

Respuestas (1)

Rostislav Teryaev
Rostislav Teryaev el 2 de Abr. de 2019
Editada: Rostislav Teryaev el 2 de Abr. de 2019
Do you need a symbolic equation? It is rather difficult to get one.
I suppose, there are two ways:
  1. Polynomial function. Read the doc for polyfit
  2. Sum of ration of polynomial functions. Read the doc for rationalfit
The first option can be (and I suppose will be) not accurate, because it is just one polynomial. So I don't reccomend it.
The second one can fit almost any data, but in my opinion it is more difficult to use. I can't give an example, because I only know the theory behind, but have never implemented it in matlab yet.
  1 comentario
Siti Fatimah Mohamed Hisham
Siti Fatimah Mohamed Hisham el 3 de Abr. de 2019
I tried fitting a rational function to the data, but still no equation appeared. Idk if im even doing it right tbh, since I'm still pretty new to MATLAB.
dataset = xlsread ('25vexcel2.xlsx','Sheet1','A1:C503');
x = dataset(:,1);
y_1 = dataset(:,2);
y_2 = dataset(:,3);
plotyy(x,y_1,x,y_2);
title('25kV Injected Voltage(a)');
ylabel('Voltage (V)');
xlabel('Time(us)');
yylabel('voltage with');
fitdata = rationalfit(x,y_1);
fitdata = rationalfit(x,y_2);

Iniciar sesión para comentar.

Categorías

Más información sobre Historical Contests en Help Center y File Exchange.

Productos


Versión

R2013a

Community Treasure Hunt

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

Start Hunting!

Translated by