scanfc

バージョン 1.0.0.0 (8.81 KB) 作成者: Peter Li
scanf rewritten to give cell arrray output
ダウンロード: 647
更新 2006/11/20

ライセンスがありません

Major bug fixes in version 1.1 from 1.0. Upgrade strongly recommended.

This is a reimplementation of sscanf done to allow cell array output. Written as a mex file in C. I've decided it isn't practical for me to try to supply binaries, so you'll have to compile the source yourself using the MatLab "mex scanfc.c" command. If you have problems with compiling please let me know.

The native MatLab sscanf returns its output as a numeric or character array. This is a clumsy method that causes many problems, particularly with reading strings. My implementation with cell array output is more flexible and cleaner to use for complicated jobs.

I started with C code from the PHP project. I retooled the code for MatLab and also simplified and cleaned up as much as possible. I tried to mimic the behavior of native MatLab sscanf in terms of what formats are accepted and how it handles unusual format strings. Documentation is included in the scanfc.m file and also as comments in scanfc.c.

I have not yet had a chance to test this against a full suite of test cases, but the performance is to spec for my tests to date.

引用

Peter Li (2024). scanfc (https://www.mathworks.com/matlabcentral/fileexchange/12929-scanfc), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R13
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersDictionaries についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0

Major bug fixes. There was a problem with using "*" for scan suppression. There was a problem with integer format scans: spillover from previous scans due to failure to null terminate the scan buffer.