Add this loop just before the mesh call:
for k = 1:size(Response_amp,1)
[Ramax(k),Idx(k)] = max(Response_amp(k,:));
Xv(k) = om_array(k,Idx(k))/(2*pi);
Yv(k) = L_array(k,Idx(k));
end
and this plot3 call after the hold call:
for k = 1:size(Response_amp,1)
[Ramax(k),Idx(k)] = max(Response_amp(k,:));
Xv(k) = om_array(k,Idx(k))/(2*pi);
Yv(k) = L_array(k,Idx(k));
end
so the complete code after the first loop is now:
%% plot
for k = 1:size(Response_amp,1)
[Ramax(k),Idx(k)] = max(Response_amp(k,:));
Xv(k) = om_array(k,Idx(k))/(2*pi);
Yv(k) = L_array(k,Idx(k));
end
fig = figure();
ax = axes();
% view(3);
hold(ax);
% view([-53 33]);
grid on
mesh(om_array/(2*pi),L_array,Response_amp,'edgecolor','k'); %Excitation frequency in Hz
xlabel('Frequency (Hz)')
ylabel('Length of the spring (m)')
zlabel('Response Amplitude (m)')
ylim([0.07 1])
zlim([0 0.3])
a = colorbar;
a.Label.String = 'Response Amplitude (m)';
set(gca,'FontSize',15)
set(gca, 'xticklabel', []);
set(gca, 'yticklabel', []);
set(gca, 'zticklabel', []);
plot3(Xv, Yv, Ramax, '^r')
view(30,30)
producing:

as desired.
.