readgenbin

版本 1.0.0.0 (2.9 KB) 作者: Cengiz Gunay
Reads a time-range of data from a binary GENESIS file.
198.0 次下载
更新时间 2012/4/19

查看许可证

Usage:
[data, time_trace] = readgenbin(filename, start_time, end_time, endian);

Parameters:
filename: Path to GENESIS file.
start_time, end_time: Time in milliseconds relative to the ACTUAL
time of the experiment at which data adquisition started
(if you start gathering data at 200 ms and you specify 0
start time it will not work). If either is [] or NaN, defaults
to beginning and end of trace, respectively. end_time is
not inclusive.
endian: (optional) Indicates file format; 'l' for little endian
and 'b' for big endian. See the "machineformat" option
in fopen for more information. Defaults to the native endian
of this computer.

Returns:
data: Data vector or matrix read.
time_trace: (Optional) Corresponding time range vector (in ms).

Description:
Files should be created by the disk_out method in the GENESIS neural
simulator. No checking for binary type is made, so if you want reliability please
ensure the file is a binary. Files written by GENESIS on big-endian
machines (like old Mac and Solaris machines with PowerPC architecture)
must be loaded with the endian='b' option. There are sanity checks to
flag that the file may be reverse-endian, but this is not automatically
corrected.

Example:
Fully read a native-endian file:
>> dat = readgenbin('mydir/myfile.bin');
Specify a time range:
>> dat = readgenbin('mydir/myfile.bin', 100, 1000);
Get a time vector back:
>> [dat, t] = readgenbin('mydir/myfile.bin', 100, 1000);
>> figure; plot(t, dat);
Force to fully load big-endian Mac file on PC platform:
>> dat = readgenbin('mydir/mymacfile.bin', NaN, NaN, 'b');

See also: fopen

Author:
Alfonso Delgado-Reyes original version based in open
binary from Simon Peron.
Cengiz Gunay <cengique _AT_ users.sf.net> for error checking, verbose
output, endian support, and other minor modifications.

引用格式

Cengiz Gunay (2024). readgenbin (https://www.mathworks.com/matlabcentral/fileexchange/36283-readgenbin), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2010b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Large Files and Big Data 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0