Using Guide, export a code to a .txt file HELP HEL HELP
Afficher commentaires plus anciens
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 commentaire
KSSV
le 11 Avr 2017
Where is this code given to export?
Réponses (1)
Walter Roberson
le 11 Avr 2017
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 commentaires
Javier Lagunas
le 11 Avr 2017
Walter Roberson
le 11 Avr 2017
fid = fopen('NameOfOutputFile', 'wt');
fprintf(fid, 'Hello World\nMy name is: ''%s''\n', NameUserGave);
Catégories
En savoir plus sur Cell Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!