Hi everyone,
I am having an hard time trying to find a way to plot multiplke lines made by 2 point, where one of them is always the same (all the lines have the same origin).
M1 and I1 are the origin for all the lines.
J and WZ are the coordinates of multiple points (in this specific case I only have 5 points). I would like to have a for loop which creates 1. a matrix with all the 5 lines 2. a plot where all the lines are plotted together.
I have tried to create 2 matrices (coordinates and min_peak in order to have some more easily handled object, but I am stuck. I am getting a non sense result right now, displayed in the following pic:
this is my code, where I get an hideous outcome.
thanks for you help
[M1,I1] = min(mean(TD_32(:,19,:),3));
where = mean_LFP_fil_2(2500:5000,19)';
[J,WZ] = findpeaks(where,MinPeakHeight=-20);
coordinates = [WZ+2500;J];
for peaks = length(coordinates)
entire = mean_LFP_fil_2(:,19)';
fig_name_199 = ['peaks slope' num2str(a)];
line(min_peak,coordinates)
saveas(gcf,[main_folder,filesep,subfolder,filesep,fig_name_199],'png')