diff options
Diffstat (limited to 'SD-VBS/common/toolbox/toolbox_basic/common/readpcm.m')
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/common/readpcm.m | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/SD-VBS/common/toolbox/toolbox_basic/common/readpcm.m b/SD-VBS/common/toolbox/toolbox_basic/common/readpcm.m new file mode 100755 index 0000000..ca736da --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/common/readpcm.m | |||
@@ -0,0 +1,12 @@ | |||
1 | function I = readpcm(filename) | ||
2 | |||
3 | fid = fopen(filename,'r'); | ||
4 | |||
5 | A = fscanf(fid,'%d\n',2); | ||
6 | I = fscanf(fid,'%c',A(2)*A(1)); | ||
7 | I = I'; | ||
8 | I = str2num(I); | ||
9 | I = reshape(I,A(2),A(1))'; | ||
10 | |||
11 | |||
12 | fclose(fid); \ No newline at end of file | ||