Generating equations from MATLAB data

Hello, I have 4 arrays of size [1 x 1500]. Say,
H1 = [h11 h12 h13 ..... h1_1500];
H2= [h21 h22 h23 ..... h2_1500];
H3 = [h31 h32 h33 ..... h3_1500];
H4 = [h41 h42 h43 ..... h4_1500];
I have to create four equations from these arrays. This is the output of the four hall sensors (ratuiometric). The plot of these arrays wrt to independent variable (which is position of magnet) looks like sinusoidal waveforms. I have attached the data i extracted in CSV format. the independent variable is the position from 0 - 1505.
Can anybody help me with this?

 采纳的回答

y=load('Hall_1_new.csv');
x=1:1505;
f=fit(x',y','fourier5');
plot(x,y);
hold on;
plot(f);

更多回答(1 个)

Hi David,
Really Thanks!
For now it is working. I will test the equations in real time. And I will post the update, if it works precisely for me.

类别

帮助中心File Exchange 中查找有关 Mathematics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by