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!