Reputation: 1
I want to create a phaseshift histogram with Matlab. I have values from -180 degrees to +180 degrees and want to plot those occurences in a circle either from the -180 to +180 degrees or just the values from the variable (shift_values) which are somewhere from -15 to 180 degrees.
I tried this but it still shows 0 to 360 degrees!
all_shifts_combined = cat(1, all_shifts{:});
valid_shifts = all_shifts_combined(all_shifts_combined >= -180 & all_shifts_combined <= 180);
edges = linspace(-180, 180, 360); % Ein Bin pro Grad
counts = histcounts(valid_shifts, edges);
theta = deg2rad(edges(1:end-1)); % Konvertiere Bin-Kanten in Radiant
polarplot(theta, counts, 'DisplayName', 'Shifts');
title('Distribution of Shifts');
legend('Location', 'northoutside');
grid on;
Upvotes: 0
Views: 22