Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
HTMLPad 2018 15.5
WeBuilder 2018 15.5
SentiMask SDK Trial 2.0.0
Track Order For Magento 2 1.0.0
Calendar 365 For Dynamics CRM 4.0
Scimbo 1.2
Odoo Furnito Theme 1.0
.Net Assemblies/WSDL Import Utility for Delphi 6.0.4.0
Devart Excel Add-in for Zendesk 1.7
Excel Add-in for Marketo 1.7
GetOrgChart 2.5.3
AnyGantt JS Gantt Charts 8.6.0
AnyChart JS Charts and Dashboards 8.6.0
Multi Vendor Ecommerce Script & Apps 4.0
Magento 2 Inventory Management Extension 1.0
Top Code
MCU 8051 IDE 1.4.7
HTMLPad 2018 15.5
BedRock IDE 1.0
Email Grabber
jQuery Slider Ken Burns 1.0
Guest Book V. 2 V2
XML Products Showcase Slider 1.0
ActivePerl 5.8.4.810/5.6.1.638
Azizi search engine script PHP 4.1.10
Adaptive multi-focus image fusion using a wavelet-based statistical sharpness measure 1.0
STDF file reader 1.0
Hotel Management - Full Board Version 6.55
The Karma Language 1.0
jQuery Accordion Photo Gallery 1.0
RLS Algorithm Demo 1.0
Top Rated
VisualNEO Web 2018.12.15
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
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
Availability Booking Calendar PHP 1.0
PHP GZ Blog Script 1.1
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

Synopsis:

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.

Properties:

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.

Example:

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

% 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
obj.render('/path/to/rendered.html');

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
http://www.dspdesignline.com/howto/207800676

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