Question about convhull code
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello everyone,
I'm using the function convhull to create a better looking hill chart. For that purpose I need to know how Matlab determines at which point the hull-curve should start. The documentation of convhull doesnt tell me anything and I'm too unexperienced to dig into the code of the function itself (that and I dont know when something is considered "reverse engineering", which might be illegal anyway).
2 commentaires
Image Analyst
le 19 Juil 2017
Please include some screen shots. You can edit any program and see what it does, at least to some extent, for example
>> edit convhull.m
Perhaps you'd be interested in the boundary() or envelope() function instead - not sure until we see your data.
Jan
le 19 Juil 2017
Modifié(e) : Jan
le 19 Juil 2017
@Ingo: You have mentioned in your other thread, that you need the hull start with the smallest X and Y position. By the way: Whenever you post multiple thread about one problem, add a link to the thread in the other forum also. Otherwise such "cross-posting" can waste the time of the ones, who write an already given answer. Thanks.
Réponse acceptée
Jan
le 19 Juil 2017
Modifié(e) : Jan
le 19 Juil 2017
Reading the M- and C-files is considered to be legal.
You can resort the output easily to be sure that it has the wanted order:
K = convhull(X,Y);
C = [X(K), Y(K)];
[~, Index] = sortrows(C); % Only the first entry matters
if Index(1) ~= 1 % Reordering required
K = circshift(K, -Index(1) + 1);
end
Now the first index in K is the position with the smallest X and Y values.
In the current Matlab version, K is ordered as you want it. But you cannot be sure if this is the general case, such that the above check is safer.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Bar Plots 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!