Is it possible to cast the id of a file?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello!
I want to open a file and by default de id is a double type.
I want to cast that value to single for example
f = single(fopen(filename,'r'));
But when I use fread
vector = fread(f,'short');
I get this result
Error using fread
Invalid file identifier. Use fopen to generate a valid file identifier.
Is there any way to solve this problem? Or is it mandatory to have a double for that variable?
Thanks in advance!
1 件のコメント
Rik
2017 年 12 月 12 日
Why would you want to cast it to single? Apparently it needs to be a double, but why would you want to change it? In future releases it might even be changed to an object, just like was done with handles.
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Scope Variables and Generate Names についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!