79246211

Date: 2024-12-03 03:47:55
Score: 0.5
Natty:
Report link

When you define layerNMI layerNMI = NMI(i, :, :); indexing the first dimension does not make sense because lambda1 is the third dimension in NMI:NMI = rand(length(lambda3), length(lambda2), length(lambda1));.

To fix the code, change it to read layerNMI = NMI(:, :, i);

lambda1 = [0, 1e-6, 1e-5, 1e-4, 1e-3];  % Z-axis
lambda2 = [0, 0.01, 0.1, 1, 10, 100, 1000];  % X-axis
lambda3 = [0, 0.5, 0.75, 1, 1.25, 1.5, 2];  % Y-axis
NMI = rand(length(lambda3), length(lambda2), length(lambda1)); 
figure;
hold on;
colormap('turbo'); 
scatterSize = 50; % Size of scatter points
for i = 1:length(lambda1)
% Extract layer data
[L2, L3] = meshgrid(lambda2, lambda3);
layerNMI = NMI(:, :, i);
x = log10(L2(:)); % \lambda2 (log scale)
y = log10(L3(:)); % \lambda3 (log scale)
z = lambda1(i) * ones(size(x)); % \lambda1
c = layerNMI(:); % NMI values as colors
scatter3(x, y, z, scatterSize, c, 'filled');
end
xlabel('\lambda_3 (log_{10})');
ylabel('\lambda_2 (log_{10})');
zlabel('\lambda_1');
colorbar;
caxis([0, 1]); 
title('3D Parameter Grid with NMI');
grid on;
view(3);
hold off;

enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Starts with a question (0.5): When you
  • Low reputation (0.5):
Posted by: liver