Compiling a Simulink 3D Animation-based Application

by

 

Use the MATLAB Compiler to compile a 3D Animation application.

vrmemb_lmco.m
clear all;
wh = vrworld('vrheat_lmco.wrl');
open(wh);
view(wh)
const=[0 1 0; 0 1 0; 0 1 0; 0 1 0; 0 -1 0; 0 -1 0; 0 -1 0; 0 -1 0; 1 0 1; 1 0 -1];
A=[1 0 1; 1 0 -1; -1 0 -1; -1 0 1; 1 0 1; 1 0 -1; -1 0 -1; -1 0 1; 0 0 0; 0 0 0];

%% Load the files in a batch and simulate
for i=1:5
    str=['rtwdemo_rsimtf_lmco_' num2str(i) '.mat'];
    load(str);
    wh.TEXT.string=['Simulation Run No.' num2str(i)];
    for j=1:10:length(rt_yout)
        C=3*rt_yout(j,1).*(const+A);
        wh.IFS_Colormap.color=C;
        vrdrawnow;
    end
end

Contact us