필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

insert 2 lines matrix inside another matrix and conditionally repeating them

조회 수: 1 (최근 30일)
Islam Hassan
Islam Hassan 2020년 7월 14일
마감: MATLAB Answer Bot 2021년 8월 20일
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?

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by