How to find the error between 2 curve ?

59 次查看(过去 30 天)
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 ?
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

采纳的回答

Karim
Karim 2022-6-17
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 个)

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by