Why does the line plot depend on the generator type in a for loop ?
Show older comments
I have :
- a set of points in two dimensions given by their coordinates x_stations and y_stations;
- a set of couples of points given by the indices of point 1 (couples_st1) and point 2 (couples_st2) for each couple;
- a subset i_subset of those couples
I would like to plot i_subset graphically as lines linking point 1 and point 2 for each couple in the subset.
The problem : depending how I am looping on i_subset :
for i = i_subset
i_couple = i;
% some code...
% generate plot
% ouptut the plotted vectors
end
or
for i = 1:length(i_subset)
i_couple = i_subset(i);
% some code ...
% generate plot
% ouptut the plotted vectors
end
I get the same output of plotted vectors, but not the same plots. Why ?
A minimal example is enclosed with input data. Just run "main_minimal_example.m".
main_minimal_example
Thank you !
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
