How to find the error between 2 curve ?
35 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dear All,
I want to find the error between 2 curves as bellow.
The red curve is standard value 100% accuracy, while the green curve is noise value. I want to find the error between red and blue curve
Could anyone help me ?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1035255/image.jpeg)
Here is the code to plot 2 curve:
load matlab.mat
plot(x,table_A.Line1,'r', x,table_A.Line2,'g',LineWidth=2)
legend
0 commentaires
Réponse acceptée
Karim
le 17 Juin 2022
Hey,
It depends on how you define the error. If you mean the difference between the two you can simply do the following:
load('matlab.mat')
MyDiff = table_A.Line2 - table_A.Line1;
figure
subplot(2,1,1)
plot(x,table_A.Line1,'r', x,table_A.Line2,'g','LineWidth',1.5)
grid on
legend('correct','with noise')
subplot(2,1,2)
plot(x,MyDiff,'LineWidth',1.5)
grid on
ylabel('error')
xlabel('data point')
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!