Using Guide, export a code to a .txt file HELP HEL HELP
이전 댓글 표시
Hey guys, I want to export this code to a txt file when I pressed a push button in guide:
cblock
cuenta1
cuenta2
cuenta3
endc
p equ d'66'
m equ d'100'
n equ d'100'
retardo
movlw p
movwf cuenta1
dec1
movlw m
movwf cuenta2
dec2
movlw n
movwf cuenta3
dec3
decfsz cuenta3
goto dec3
decfsz cuenta2
goto dec2
decfsz cuenta1
goto dec1
return
thank you very much,
댓글 수: 1
KSSV
2017년 4월 11일
Where is this code given to export?
답변 (1개)
Walter Roberson
2017년 4월 11일
S = { 'cblock '
'cuenta1'
'cuenta2'
'cuenta3'
'endc'
''
'p equ d''66'' '
'm equ d''100'' '
'n equ d''100'' '
'retardo'
'movlw p'
'movwf cuenta1 '
'dec1'
'movlw m'
'movwf cuenta2 '
'dec2'
'movlw n'
'movwf cuenta3 '
'dec3'
'decfsz cuenta3 '
'goto dec3 '
'decfsz cuenta2'
'goto dec2'
'decfsz cuenta1'
'goto dec1'
'return' };
fid = fopen('NameOfOutputFile', 'wt');
fprintf(fid, '%s\n', S{:});
fclose(fid);
Are you certain that you want the trailing blanks on lines? You do not appear to have used trailing blanks in a consistent manner.
댓글 수: 2
Javier Lagunas
2017년 4월 11일
Walter Roberson
2017년 4월 11일
fid = fopen('NameOfOutputFile', 'wt');
fprintf(fid, 'Hello World\nMy name is: ''%s''\n', NameUserGave);
카테고리
도움말 센터 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!