File Exchange

image thumbnail

Vector to Bus

version 1.1.1 (42.6 KB) by thomas
Vector to bus conversion in Simulink


Updated 02 Dec 2019

GitHub view license on GitHub

Convert a vector of doubles into a (non-virtual) bus object. The input vector size must match the size of all the bus elements.

Unlike the built-in bus to vector block, the data type of the bus elements need not be consistent (input vector is cast to each elements data type). The top level bus may also contain nested nested buses, but arrays of buses are not supported.

As the S-Function contains simStruct macros that are not supported during code generation a TLC file is provided to inlines the S-Function during code generation.

Tested only on Linux (Ubuntu). Probably needs some changes to compile on Windows.

Build with:
>> mex('CFLAGS="$CFLAGS -std=c99 -Wall"','v2b_sf.c');

Cite As

thomas (2020). Vector to Bus (, GitHub. Retrieved .

Comments and Ratings (0)





TLC bug fixes


Edit platform compatibility.

MATLAB Release Compatibility
Created with R2018a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags