Minimize difference between vectors by varying scalar
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
alberto tonizzo
le 18 Mai 2022
Commenté : alberto tonizzo
le 22 Mai 2022
Hello,
I'm trying to use fminsearch to find the scalar (a) that minimizes the difference between 2 vectors of dimension N, i.e. diff = abs(x - a*x_model).
The difference (diff) is a vector of dimensions 1xN and fminsearch outputs also a vector of dimensions 1xN, but I would like to just have a scalar value for a.
Also, should diff be normalized by the mean of x?
I hope my explanation is clear, thank you in advance.
1 commentaire
Torsten
le 18 Mai 2022
You cannot minimize a vector (in your case diff = abs(x-a*x_model)). You can minimize the norm of a vector.
For diff = x-a*x_model, you must decide which norm to take.
Réponse acceptée
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!