Won't update the second graph
显示 更早的评论
b1 = a1(a1 ~= 0);
b2 = a2(a2 ~= 0);
b3 = a3(a3 ~= 0);
b4 = a4(a4 ~= 0);
ind = ~ismissing(b1);
ind1 = ~ismissing(b3)
% load('nameoffile.mat','b1','b2','b3','b4')
%
% save("nameoffile.mat","b1","b2","b3","b4",'-append')
figure(2);
subplot(1,2,1);
drawnow
hAxes = gca;
hold(hAxes,"on");
xlabel('CSI Amp');
ylabel('Keyhole Amp Low Res');
%plot(hAxes,b1(ind),b2(ind));
scatter(b1(ind),b2(ind),'filled')
[R,p] = corrcoef(b1,b2);
R = R(2);
p = p(2);
title(['R =' num2str(R) ', p =' num2str(p)]);
hold(hAxes,"off");
subplot(1,2,2);
drawnow
gAxes = gca;
hold(gAxes,"on");
xlabel('CSI R2M Amp');
ylabel('Keyhole R2M Amp Low Res');
%plot(gAxes,b3(ind1),b4(ind1),'o');
scatter(b3(ind1),b4(ind1),'filled')
[R,p] = corrcoef(b3,b4);
R = R(2);
p = p(2);
title(['R =' num2str(R) ', p =' num2str(p)]);
hold(gAxes,"off");
So I am trying to make two graphs on one tab. The one on the left will work fine, but the one on the right won't work. This only happens for certain sets of data when there is a NaN in the selected set. I used the "ind = ~ismissing(b1);" part to get b2 to ignore the coresponding point. But for some reason it does not want to graph b3 or b4 despite having the variables update correctly. It really just wont plot at all. Any and all advice is welcomed, thanks in advance!
6 个评论
Torsten
2023-6-6
Do b3 and b4 have the same size ? Do they contain Inf or -Inf elements ?
the cyclist
2023-6-6
Can you upload a set of data for which the plots work as expected, and a set of data for which it does not?
William
2023-6-6
William
2023-6-6
the cyclist
2023-6-6
FYI, to upload a MAT file with the data, you can use the paper clip icon in the INSERT section of the toolbar.
William
2023-6-6
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Graphics Performance 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
