Info

此问题已关闭。 请重新打开它进行编辑或回答。

fprintf - a troubling question

2 次查看(过去 30 天)
Nick DeMarchis
Nick DeMarchis 2019-5-23
关闭: MATLAB Answer Bot 2021-8-20
Hi there! In the introduction to my program, I use the lovely fprintf command as follows:
fileID = fopen(audioFileName);
aFHead = (fread(fileID,[1 44])');
Now, after doing some processing with bits imported, I now have a int16 array called aFNew. I know the first line should be
expID = fopen(strcat('new',audioFileName));
in order to get this ID that I need, but how should I proceed to writing my data to the same filetype as the original? The data in both aFHead and aFNew is of the same type and length, so how should I finish this? Thanks!

回答(1 个)

per isakson
per isakson 2019-5-23
编辑:per isakson 2019-5-23
See Export Binary Data with Low-Level I/O . You should use fwrite(), not fprintf()

此问题已关闭。

产品


版本

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by