dir *.txt
help fopen
open Portugues.txt
fid = fopen( 'Portugues.txt', 'r' )
TEXTO = fgetl( fid );
fclose( fid )
TEXTO(1:20)
double( TEXTO(1:20) )
plot( TEXTO, '.-' )
plot( double(TEXTO), '.-' )
double( 'a' )
double( 'A' )
double( 'a' )
double( 'ã' )
char( 227 )
char( 97 )
for j=1:255, disp( sprintf( '%3d %s', j, char(j) ) ), end
for j=1:255
disp( sprintf( '%3d %s', j, char(j) ) ),
end
ONDE_ESPACO = find( TEXTO==32 );
TAMANHOS = diff( ONDE_ESPACO ) - 1;
whos
figure, hist( TAMANHOS, 1:50 )
figure, hist( TAMANHOS, 1:20 )
Tm = mean( TAMANHOS )
sT = std( TAMANHOS )
dentro_1s = find( abs(TAMANHOS-Tm)<=1*sT );
length( dentro_1s )
length( TAMANHOS )
f1s = length( dentro_1s )/ length( TAMANHOS )
f1s = mean( abs(TAMANHOS-Tm)<=1*sT )
mean( abs(TAMANHOS-Tm)<=2*sT )
mean( abs(TAMANHOS-Tm)<=3*sT )
hold on
xis = linspace(0,20,1e3);
N = length( TAMANHOS );
yG = (N/(sqrt(2*pi)*sT))*exp(-.5*((xis-Tm)/sT).^2)
yG = (N/(sqrt(2*pi)*sT))*exp(-.5*((xis-Tm)/sT).^2);
hold on, plot( xis, yG, '-r' )
hold on, plot( xis, yG, '-r', 'linewidth', 3 )
Portugues.txt
analisa_palavras_script
Ingles.txt
help uiload
doc uiload
help input
help uiopen
[fn,pn] = uigetfile( '*.txt', 'Nome do arquivo' )
fullfile
help fullfile
close all
clear
home
whos
figure, hist( double(TEXTO), 1:255 )
[ yh, xh ] = hist( double(TEXTO), 1:255 );
for j=1:255
if yh(j)>0
disp( sprintf( '%3d %s %d', j, char(j), yh(j) ) )
end
end
onde_225 = find( TEXTO=225 )
onde_225 = find( TEXTO==225 )
TEXTO( onde_225(1)+(-10:10) )
TEXTO( onde_225(3)+(-10:10) )
double( 'az' )
BLABLABLA = char( fix(97+25*rand(1,50)) )
BLABLABLA = char( fix( 97+26*rand(1,50) ) );
BLABLABLA( BLABLABLA==123 ) = 32
BLABLABLA = char( fix( 97+26*rand(1,50) ) );
max(BLABLABLA)
BLABLABLA = char( fix( 97+26*rand(1,50) ) );
max(BLABLABLA)
BLABLABLA = char( fix( 97+26*rand(1,50) ) );
max(BLABLABLA)
BLABLABLA = char( fix( 97+26*rand(1,50) ) );
max(BLABLABLA)
BLABLABLA = char( fix( 97+26*rand(1,50) ) );
max(BLABLABLA)
BLABLABLA = char( fix( 97+26*rand(1,5000) ) );
max(BLABLABLA)
97+25
97+24
BLABLABLA = char( fix( 97+27*rand(1,50) ) );
BLABLABLA( BLABLABLA==123 ) = 32
BLABLABLA = char( gera_inteiro(yh,50) )
BLABLABLA = char( gera_inteiro(yh,50).' )
BLABLABLA = char( gera_inteiro(yh,length(TEXTO)).' );
whos
fid = fopens( 'Fake_Portugues.txt', 'w' )
fid = fopen( 'Fake_Portugues.txt', 'w' )
help fprintf
fprintf( fid, '%s', BLABLABLA )
fclose( fid )
analisa_palavras_script
analisa_letras_script
help findstr
onde_wri = findstr( TEXTO, ' wri' )
onde_wri = findstr( TEXTO, 'write' )
onde_wri = findstr( TEXTO, ' bata' )
for j=1:length(onde_wri)
disp( TEXTO(onde_wri(j)+(0:20)) )
end
