SAME VALUE ON EVERY LOOP...
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
HI EVERYONE. need some help here...
my code is giving me the same output on every run and no matter what im doing, its giving me the same output.
here is a snippet of whats going on.
data = 2;
point = [1 2 3 ;
4 7 8 ; ]; %% for point clouf.
ptcloud = pointCloud(centroidlocation);
radius = 15;
lesion = 5;
for p =1: data
temp_point = point(p,:);
% Get the indices and the distances of points that lie within the specified radius
[indices,dists] = findNeighborsInRadius(ptcloud,temp_point,radius);
ptcloudB = select(ptcloud,indices);
indices_1 = length(indices);
% change material properties of lesion
for i=1:indices_1
t_id = elem_e(:);
t_id(indices)= lesion;
end
% do whatever for point
% multiple loops to find stuff
file_name (p) = min (whatever);
file_name_2(p) = min (whatever2);
file_name_3 (p) = min (whatever3)
end
help please!!!!
3 commentaires
VBBV
le 2 Oct 2020
%if true
% code
% end
% change material properties of lesion
for i=1:indices_1
t_id = elem_e(:);
t_id(i)= lesion;
end
Try the loop index in t_id.
Réponses (1)
Steve Eddins
le 2 Oct 2020
This loop in your code looks suspicious to me:
% change material properties of lesion
for i=1:indices_1
t_id = elem_e(:);
t_id(indices)= lesion;
end
Perhaps I am misunderstanding something, but it looks like t_id will be unchanged after the first iteration through the loop body. Is there a programming error here?
If you haven't done this already, then I recommend that you try using the debugger. Set a breakpoint at the beginning of the code, then execute it. Single-step through each line of the code, pausing to inspect the values of variables that just got changed. See if the values are what you expect. In case you are not familiar with the debugger, here is a documentation link.
0 commentaires
Voir également
Catégories
En savoir plus sur Large Files and Big Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!