Effacer les filtres
Effacer les filtres

i have two curves how to find relation between two curves in matlab. that is If I have two curve A and B. I need to find a relation such that A=XB. what is X value?

6 vues (au cours des 30 derniers jours)
i have two curves how to find relation between two curves in matlab. that is If I have two curve A and B. I need to find a relation such that A=XB.

Réponses (1)

Image Analyst
Image Analyst le 18 Août 2021
How about this:
t = 1 : 10;
A = t .^ 2 + 20
B = 2 * A - 10;
plot(t, A, 'b-');
hold on;
plot(t, B, 'r-');
grid on;
legend('A', 'B');
X = A ./ B
% Check it:
X .* B
This isn't your homework is it?
  6 commentaires
Stephen23
Stephen23 le 18 Août 2021
Modifié(e) : Stephen23 le 18 Août 2021
"...like what is the offset between these two curves"
In your question and previous comment you specified that you want some kind of scaling factor X.
Now you write that you want the "offset" between the two curves.
Which do you want: an offset or a scaling factor?
Note that in general neither of these will fullfile your requirement "that B curve should become A curve".
Image Analyst
Image Analyst le 18 Août 2021
If you just want the mean scalar to scale it you can do
factor = mean(A ./ B);
Aestimated = factor * B;
However B will not match up with A everywhere.
Are you trying to do Multivariate Curve Resolution but just don't know it? This is where you can get a set of "loadings" for building up an arbitrary curve with a set of predefined "library" curves. So using the proper weights (loadings) you can weight and sum the library curves to get you your desired curve.

Connectez-vous pour commenter.

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by