How to make tracks start from same origin?
Mostrar comentarios más antiguos
I am collecting cell movement tracks from MTrackJ, an ImageJ plugin. I can pass the coordinates of the tracks to an array, but I am trying to make a flowerplot, wherein all my tracks start at the same point and then trace their paths from there. Below is the code I am using so far:
prompt = 'How many tracks do you want to analyze?';
track_num = input(prompt);
disp('Select the track you wish to analyze.')
figure(); hold on for i=1:track_num
filename = uigetfile('*.mdf','C:\Users\Szasz_T\Documents\Matlab'); %Note: file name cannot contain underscores
Track= read_mdf(filename);
Track(:,3:4) = Track(:,3:4)*0.12; %Multiplies by um/pixel; change to whatever ratio you acquire images at
Track(:,6) = Track(:,6)*10; %Multiplies by number of seconds per frame
norm(Track(end,3:4)-Track(1,3:4))/(Track(end,6)-Track(1,6))%Outputs distance traveled in um/s
for i = 1:size(Track,1)-1 %Calculates length of each step in trajectory
Track_steps(i) = norm(Track(i+1,3:4)-Track(i,3:4));
end
zeroes = [0 0 0 0 0 0];
Track = cat(1,zeroes, Track);
plot(Track(:,3), Track(:,4))
end
hold off
title('Representation of Cell Motility')
I can use my "zeroes" array to force the first coordinate to be a certain point, but I do not know how to simply set all tracks to begin at one origin, if this is possible.
Thanks for any help one can offer.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!