GithubHelp home page GithubHelp logo

simalpha / matlab-bson Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kyamagu/matlab-bson

0.0 1.0 0.0 300 KB

Matlab BSON encoder based on libbson.

License: Apache License 2.0

MATLAB 15.88% C 82.90% C++ 1.23%

matlab-bson's Introduction

Matlab BSON

Matlab BSON encoder based on libbson.

BSON is a bin­ary-en­coded seri­al­iz­a­tion of JSON-like doc­u­ments. This package contains API to convert Matlab variables to and from BSON binary. It is useful for exchanging data with Matlab and other programs written in different language.

Build

A UNIX environment is required to build the package. Get necessary tools to build libbson (automake, autoconf, libtool, gcc, make). If you don't have libbson installed in the system, you need the Internet connection. Also mex -setup if you have never used mex command in Matlab.

Once all the requirements are met, type the following in Matlab to build. This will automatically download and compile the libbson package to build the Matlab API.

addpath /path/to/matlab-bson;
bson.make;

Check help bson.make for the detailed instruction.

Example

parrot = struct( ...
  'name', 'Grenny', ...
  'type', 'African Grey', ...
  'male', true, ...
  'age', 1, ...
  'birthdate', {bson.datetime(now)}, ...
  'likes', {{'green color', 'night', 'toys'}}, ...
  'extra1', [] ...
  );
bson_value = bson.encode(parrot);
assert(bson.validate(bson_value));
parrot = bson.decode(bson_value);
disp(bson.asJSON(bson_value));

API

asJSON    Convert BSON to JSON.
datetime  Datetime type in BSON format.
decode    Deserialize value from BSON format.
encode    Serialize value in BSON format.
fromJSON  Convert JSON to BSON.
make      Build a driver mex file.
read      Read bson from file.
validate  Validates BSON format.
write     Write variable to a BSON file.

Check help bson for detail.

matlab-bson's People

Contributors

kyamagu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.