Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

insert 2 lines matrix inside another matrix and conditionally repeating them

1 Ansicht (letzte 30 Tage)
Islam Hassan
Islam Hassan am 14 Jul. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I want to integrate two lines inside matrix and repeated frequently depending on next lines like the following example:
The original matrix:
A = [ G1 X8 Y118
G0 X8 Y135
G1 X 8 Y 150
G0 X 8 Y 172
G1 X 8 Y 209
G0 X 8 Y 242
G1 X 8 Y 410
G0 X 9 Y 208
…….. ] so on
Generated matrix
AA = [
M 802
M 800 P 8
G1 X8 Y118
M802
M800 P9
G0 X8 Y135
M 802
M 800 P 8
G1 X 8 Y 150
M 802
M 800 P 9
G0 X 8 Y 172
M 802
M 800 P 8
G1 X 8 Y 209
M 802
M 800 P 9
G0 X 8 Y 242
M 802
M 800 P 8
G1 X 8 Y 410
M 802
M 800 P 9
G0 X 9 Y 208
…………] so on
So before any line begin with G1, put
M802
M800 P8
And before any line begin with G0, put
M802
M800 P9
How can we do this?

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by