Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

insert 2 lines matrix inside another matrix and conditionally repeating them

1 visualización (últimos 30 días)
Islam Hassan
Islam Hassan el 14 de Jul. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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?

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by