Hi,
I have two datasets, dataset 1 is the result of experiment (a peak) and the dataset 2 is the result of simulation (a peak). Normally, both datasets should be plotted in the same figure in logarithmic scale and then, to shift the dataset 2 towards dataset 1 and to find the best vertical translation.
The point is that the amount of shift in logarithmic scale is not a constant value for each point (in the contrary to linear scale) and it depends on the Y values of the data (bigger Y value, bigger shift).
I have tried to write a code to do it automatically but it didn't work and I don't know how to code it!
Tnanks in advance for any help and any idea.

 Réponse acceptée

J. Alex Lee
J. Alex Lee le 3 Oct 2022

0 votes

shifting in log scale is actually a multiplication, not an addition - is that what you need?

3 commentaires

Mehrdad RAHIMI
Mehrdad RAHIMI le 3 Oct 2022
Modifié(e) : Mehrdad RAHIMI le 3 Oct 2022
Thanks for reply, could you please provide more information about what you said? I know a way to code it but I could say it's not a simple code with few lines; actually, what I am looking for is that if there is a function or a trick with few lines of code that does this operation.
If your idea works simpler, I will use it to make to code simpler.
Torsten
Torsten le 3 Oct 2022
Modifié(e) : Torsten le 3 Oct 2022
Multiply one of the data sets by a constant factor a ( e.g. multiply data1 by a = data2(1)/data1(1) ) and see what happens.
Note that multiplication results in a shift in logarithmic scale:
log10(a*data) = log10(a) + log10(data)
J. Alex Lee
J. Alex Lee le 3 Oct 2022
An equation is worth a hundred words :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Preprocessing dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by