By sugestion of the cyclist:
I found it. If anyone needs it there it is:
function []= Test (TRACTS%%Cell with structs within, INFO%Information about each tract)
close all;
for i=1:INFO.n_count
clear V;
for j=1:size(TRACTS{i})
G(j) = TRACTS{i}(j,1);
H(j) = TRACTS{i}(j,2);
I(j) = TRACTS{i}(j,3);
J = G(j)-G(1);
K = H(j)-H(1);
L = I(j)-I(1);
V(j,1)=J;
V(j,2)=K;
V(j,3)=L;
W(i,j) = abs(V(j,1))+abs(V(j,2))+abs(V(j,3));
end
M = [abs(V(j,1))/W(i,j) abs(V(j,2))/W(i,j) abs(V(j,3))/W(i,j)];
plot3(TRACTS{i}(:,1),TRACTS{i}(:,2),TRACTS{i}(:,3),'Color',M);grid on;
hold on;
end
end
I am not sure of what you pretended Jan Simon. I need to change the number of iterations for each position of the cell TRACTS, because the number of points used to generate a track differs. I made this code and he works reasonibly well. However i am open to any changes that you or anyone sugest in order to enhance this code :)
Best Answer
Spacing is important in this case, because of command/function duality