readgenbin

Reads a time-range of data from a binary GENESIS file.
199 download
Aggiornato 19 apr 2012

Visualizza la licenza

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.

Cita come

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

Compatibilità della release di MATLAB
Creato con R2010b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Large Files and Big Data in Help Center e MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0