Иллюстрированный самоучитель по Matlab

         

» fid = fopent 'c:\sin.txt'. V);


).

Примеры:

» х = 0:pi/10:pi:y-[x:sin(x)];

» fid = fopent 'c:\sin.txt'. V);

» fprintf(fid.'X5.3f *10.6f\n'.y):fclose(fid);

0.000 0.000000

0.314 0.309017

0.628 0.587785

0.942 0.809017

1.257 0.951057

1.571 1.000000

1.885 0.951057

2.199 0.809017

2.513 0.587785

2.827 0.309017

3.142 0.000000

» fid = fopen('c:\sin.txt'.'r');

» q=fscanf(fid.'*g'.[2.10]):

» q

'

ans =

0 0

0.3140 0.3090

0.6280 0.5878

0.9420 0.8090

1.2570 0.9511

1.5710 1.0000

1.8850 0.9511

2.1990 0.8090

2.5130 0.5878

2.8270 0.3090

 » fgetl(fid) 

ans =

3.142 0.000000 

» fgets(fid) 

ans =

-1

» fclose(fid) 

ans=

0


Содержание  Назад  Вперед