How to write a for loop ?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to write a for loop that extracts a label out of a variable that i have labeled marker_labels_single. I then need it to create a new label that adds _x, _y, _ z to the end of the label. I truly have no idea how to do this
0 commentaires
Réponses (1)
Walter Roberson
le 2 Nov 2022
marker_labels_single = {'peppers', 'moths', 'grues'};
xlabels = marker_labels_single + "_x"
ylabels = marker_labels_single + "_y"
zlabels = marker_labels_single + "_z"
2 commentaires
Walter Roberson
le 6 Nov 2022
for K = 1 : length(marker_labels_single)
labels = marker_labels_single{K} + "_" + ["x" "y" "z"]
end
Voir également
Catégories
En savoir plus sur MATLAB Coder 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!