# Find coefficient in order to match two functions with Neural Network

1 visualización (últimos 30 días)
Marco Pellegrino el 30 de Oct. de 2021
Comentada: Marco Pellegrino el 6 de Dic. de 2021
I'm trying to optimize an output varying some coefficient. To do this I have an array (X) with different values. My output Y will be a function of X. I want to optimize Y varying X to have Y equal to an ideal one (Yideal). I'll give you some examples.
I have an array like:
X=[1 2 3 4 5 6]
My output is something like Y=f(X).
What I've done is something strange and works just partially.
I created a random vector with k=rand(length(X),1)*0.250+875; that will be multiplied by X.
Xc=X.*k';
Y will be slightly different.
Next, I will calculate the RMSE=sqrt((Y(Xc)-Yideal).^2) and, with a cycle, I search for the vector k that minimizes my RME.
The problem is that it works but it's very slow and it's too random. I'm asking if there is a way with Neural Network to find k vector that reduces RMSE.
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Respuestas (1)

Sahil Jain el 15 de Nov. de 2021
The problem you have described is known as linear regression. You can go through the Linear Regression documentation page to learn more about how to solve such problems in MATLAB.
##### 2 comentariosMostrar NingunoOcultar Ninguno
Marco Pellegrino el 6 de Dic. de 2021
Okay, i'll try it. Thx a lot
Marco Pellegrino el 6 de Dic. de 2021
The problem is that the Y vector has not the same number of element of X vector.

Iniciar sesión para comentar.

### Categorías

Más información sobre Statistics and Machine Learning Toolbox 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!

Translated by