English 中文(简体)
从文本档案中阅读
原标题:Read from text file as a char array

I want to read from a text file and process the text (compress incrept). I am using the textread function in MATLAB. My problem is that it is not reading the white spaces correctly.

该守则是:

w=textread( in.txt , %c , delimiter , 
 , whitespace ,  );

e=double(w);
[z,x]=size(e);
r=vec2mat(e,ceil(z/100));
r=uint8(r);
imwrite(r, jocop.gif )
[t,y]=norm2lzw(uint8(e),z);
u=vec2mat(t,ceil(z/100));
imwrite(double(u), compro.gif )

你会注意到,我正在使用<代码>%c,以便获得一个果园,而不是一个电池阵列,但我仍然无法得到白天空间。 任何建议?

问题回答

www.un.org/Depts/DGACM/index_russian.htm

w=textread( in.txt , %c , delimiter , 
 , whitespace ,   );

这是这样做的适当方式。





相关问题
Is There Any Way Without File.ReadAllText?

As I love to develop file I/O applications and my new development platform is Windows Mobile. Is there any way to read all the file, without using File.ReadAllText? Because Windows Mobile doesn t ...

File paths in Java (Linux)

I have created a Java application that loads some configurations from a file conf.properties which is placed in src/ folder. When I run this application on Windows, it works perfectly. However when I ...

How do I create a string using a loop variable in MATLAB?

I have a loop like this: for i=1:no %some calculations fid = fopen( c:\out.txt , wt ); %write something to the file fclose(fid); end I want data to be written to different files like ...

热门标签