Creating string lines with Matlab Code
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
i want to create the following lines with my Matlab Code:
model.component('comp1').coordSystem.create('sys1', 'Cylindrical');
model.component('comp1').coordSystem.create('sys2', 'Cylindrical');
model.component('comp1').coordSystem.create('sys3', 'Cylindrical');
But its not 3 rows in every case so this number should be a variable.
I guess I need to work with a loop but I wont make it work.
Can someone help me?
THANK YOU!
12 commentaires
Réponses (1)
Walter Roberson
le 15 Avr 2022
component_prefix = "comp";
component_number = 1:2; %row
sys_prefix = "sys";
sys_numbers = (1:3).'; %column
output = "model.component('" + component_prefix + component_number + "').coordSystem.create('" + sys_prefix + sys_numbers + "', 'Cylindrical')"
2 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!