How to properly write a matrix in a for loop?
Afficher commentaires plus anciens
Hello everyone,
I have been trying various ways to create a gcode for 3D printers. My probably last goal will be to create such a code only in MATLAB without external software being active. Hence I have written a code which should give me a total of 12 gcode unnested gcode instructions (equal to the data_test attachment of a 1 x 12 cell):
for gc = 1:12
append_1 = transpose(repelem("G1",height(Importset{1, gc})));
append_2 = transpose(repelem("F1200",height(Importset{1, gc})));
append_3 = transpose(repelem("X",height(Importset{1, gc})));
append_4 = transpose(repelem("Y",height(Importset{1, gc})));
append_5 = transpose(repelem("Z",height(Importset{1, gc})));
T3 = Importset{1, gc}(:,1);
T4 = Importset{1, gc}(:,2);
T5 = Importset{1, gc}(:,3);
g_code = [append_1 + append_3 + T3 + append_4 + T4 + append_5 + T5 + append_2]; % this gives me only one out of the inital 12 cells !!
end
The result, see the attachment file "g_code_unfinished", is just one out of the twelve cells and not the desired full twelve cells. So I would like to ask you where my mistake is?
1 commentaire
David Mrozek
le 16 Mar 2021
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Big Data Processing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!