Code Directory
 Visual Basic & VB.NET
New Code
Vue Injector 3.3
Spectrum Analyzer pro Live 2019
Devart Excel Add-in for HubSpot 2.1
RentALLScript - Airbnb clone 2.2
SuiteCRM Theme Customization 7.11.6
iScripts NetMenus 3.1
iScripts EasyIndex 2.2
iScripts EasySnaps 2.0
Australia MyPost shipping For Magento 2 1.0.0
Australia Post eParcel For Magento 1.1.1
Source Control for SQL Server 2.0
Answers phpSoftPro 3.12
Exlcart 2.0
School College ERP 1.3.2
White-label Grocery Delivery App Solution 2.0
Top Code
iScripts EasySnaps 1
iScripts EasyIndex 1
iScripts NetMenus 2.0
ATN Site Builder 3.0
IcrediBB Bulletin Board System 1.0
Azizi search engine script PHP 4.1.10
Simple Comments Script 0.930
Vue Injector 3.3
Guestbook PHP Script 1.1
DBForms from MSAccess to PHP+PostgreSQL 1.0.0
Devart Excel Add-in for HubSpot 2.1
White-label Grocery Delivery App Solution 2.0
EV Widget Post 0.3
Stepping stone algorithum for solving the transhipment problem
GuestBook PHP 2 Script 1.10
Top Rated
phpEnter 5.1.
Quick Maps For Dynamics CRM 3.1
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
EMat: Embedded Matlab Templating 1.0
File ID: 83601

EMat: Embedded Matlab Templating 1.0
Download EMat: Embedded Matlab Templating 1.0http://www.mathworks.comReport Error Link
License: Shareware
File Size: 10.0 KB
Downloads: 11
Submit Rating:
EMat: Embedded Matlab Templating 1.0 Description
Description: EMAT Embedded Matlab templating

EMat class provides a templating system in Matlab like Ruby's ERB
system. Matlab code can be embedded inside any text document to
easily control the document generation flow.

A simple example is illustrated here:
>> x = 42;
>> tmpl = ' The value of x is <%= x %>';
>> obj = EMat(tmpl);
>> disp(obj.render);
The value of x is 42


obj = EMat
obj = EMat( S )
obj = EMat( file_path )

obj.set( S )
obj.set( file_path )

S = obj.render()
obj.render( file_path )

obj = EMat creates an empty EMat object. EMat object accepts
template string either by string variable S or by specifying a
path to the template text file_path. To set a template to the
object, use obj.set(S) or obj.set(file_path). EMat(S) and
EMat(file_path) are the shorthand for obj=EMat; obj.set(...);

S = obj.render() returns a string of the rendered document.
obj.render(file_path) instead renders output to a file specified
by the file_path.


tmpl_path: template file path. Use set() method to change
tmpl: template string. Use set() method to change
errchk: logical flag to enable/disable syntax check
(default: true)
trim: logical flag to enable/disable whitespace trim when
suppresseing newline at the end (default: true)

Template format:

Any text document can embed matlab code with the following syntax.

<% stmt %> matlab statement
<% stmt -%> matlab statement with newline suppression at the end
<%= expr %> matlab expression with rendering
<%# comt %> comment line
<%# comt -%> comment line with newline suppression at the end
<%% %%> escape to render '<%' or '%>', respectively

<%= expr %> renders output of the matlab expression to the output.
Note that numeric variables will be converted to string by
NUM2STR(). When -%> is specified at the end of the line in
statement or comment, a following newline will be omitted from the
rendering. Any other texts appearing outside of these special
brackets are rendered as is. When trim property is set true,
leading whitespace in the template is also removed from the output
with newline suppression syntax.


<!-- template.html.emat -->
<head><title><%= t %></title></head>
<%# this is a comment line -%>
<p><%= a %></p>
<% for i = 1:3 -%>
<li><%= i %></li>
<% end -%>

% In your matlab code
% Prepare variables used in the template
t = 'My template document';
a = 10;

% Create an EMat object
obj = EMat('/path/to/template.html.emat');

% Render to a file

License: Shareware

Related: Render, 039lt039, escape, Comment, Rendering, 039gt039, num str, omitted, converted

O/S:BSD, Linux, Solaris, Mac OS X

File Size: 10.0 KB

Downloads: 11

More Similar Code

Embedded MATLAB block provides a way of bringing restricted subset of MATLAB into Simulink. There are couple of possibilities when moving untimed MATLAB algorithms into Simulink. This demo illustrates two such alternatives in porting a sample viterbi algorithm (written in M) into Simulink using embedded MATLAB.

The subsystem 'eML_viterbi_ex1' implements the whole algorithm in a single monolithic embedded MATLAB block, where as...

The attached model implements a Sobel edge detection algorithm in Embedded MATLAB.

This demo shows how to read in an image operate on the serialized data and reconstruct the image back from serialized data after applying Sobel...

The adaptive median filter is discussed in recent designline article about embedded MATLAB block

Also attached is a power point presentation that explains the concept of serialization...

Instead of Triangular wave generator from Library browser Embedded Matlab func (user defined) is used. Make sure that tha amplitude of sine and triangle wave are equal.and also the freq of triangular is not less than twice the freq of sine...

The help section includes instructions for building a MEX function using the EMLMEX command, and for generating C-code using the EMLC command.

For more information about the Embedded MATLAB subset, please visit the MathWorks...

The models included shows three different ways to implement a kalman filter in Simulink(R). The first uses the kalman function in control system toolbox to design a steady state kalman filter. The second is an embedded MATLAB(R) block...

DFT plays important role in DSP and used in wide variety of applications like correlation and spectral analysis. Understanding quantization errors in its computation is an important aspect of its design either for s/w or h/w implementation.

A Lambert-orbital boundary value problem can be stated as

"Find the orbit/trajectory of a spacecraft that flies from position [r1] to [r2], taking a time [tf] and making [m] complete orbits before arriving at [r2]. "

Three H bridges are used with three unequal distributed DC sources (1:3:9). Embedded Matlab function is used to generate switching pulse for generating 230V, 50Hz. The model can be used for the applications like drives, inverter etc.,

This model presents how one may be able to detect whether an image is in or out of focus using the FFT. StateflowdlT« is used to manage state behavior; the model also makes use of Embedded MATLAB and integration of legacy C code. When running...

User Review for EMat: Embedded Matlab Templating
- required fields

Please enter text on the image