Won't update the second graph
Mostrar comentarios más antiguos
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 comentarios
Torsten
el 6 de Jun. de 2023
Do b3 and b4 have the same size ? Do they contain Inf or -Inf elements ?
the cyclist
el 6 de Jun. de 2023
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
el 6 de Jun. de 2023
William
el 6 de Jun. de 2023
the cyclist
el 6 de Jun. de 2023
FYI, to upload a MAT file with the data, you can use the paper clip icon in the INSERT section of the toolbar.
William
el 6 de Jun. de 2023
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Graphics Performance en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
