How do I find the difference between two plots when the dimension of two matrices are not the same?
3 次查看(过去 30 天)
显示 更早的评论
Hi everyone, I'd like to find the difference between two plots (at y-axis) but I don't really know how because of the matrixes have different dimensions. The data_frequency matrix is 1x345 double and patient's threahold is 1x18 double.
I've tried using cftool to see if i could get functions from the plot but it didn't work.

% Normal threshold
load('data_frequency.mat');
figure (1)
semilogx(f,pressure);
hold on
% Patient's threshold
p_f = [3,4,8,10,20,40,80,100,200,400,800,1000,2000,4000,8000,10000,12000,15000];
p_p = [142,140,136,132,123,82,58,70,80,84,45,20,3,8,30,40,46,60];
semilogx(p_f,p_p);
xlabel('frequency (Hz)');
ylabel('sound pressure (dB)');
title('Normal hearing threshold vs patient hearing threshold');
legend('normal threshold','patient threshold');
0 个评论
回答(1 个)
Image Analyst
2018-12-9
You unfortunately forgot to attach 'data_frequency.mat'.
But what I'd do it to interpolate the same number of points between them, like use interp1() to generate two signal arrays of 1000 points each. Then you can subtract them and multiply by delta f to get area between curves, if that's what you want.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!