Home > Programming, Technology > Publish MATLAB output as a document(html, doc, LaTex, Powerpoint etc.,)

Publish MATLAB output as a document(html, doc, LaTex, Powerpoint etc.,)


Here I wanted to share how did I convert the matlab output to the specific document using the publish command of matlab. We can also run the matlab code from outside matlab window.

The following steps are to be followed to run the matlab code from command prompt.
step1: First edit PATH system variable and set the matlab path as [MATLABINSTALLEDFOLDER/bin/]
step2: Now from the command prompt we can run any file using the following code
<pre>
matlab -r scriptname (without the .m extension but first we have to change directory to the source existing folder)
ex: c:\Users\MyWindows7\MATLAB > matlab -r example
[example.m is the actual script to be run]
</pre>
Now let us actually see how we can publish an output of script as a document

function [ret]= publishToFormat(filename, format)
    options_doc_nocode.format= format;
    options_doc_nocode.outputDir = 'd:/matlabNDVIOutput';
    options_doc_nocode.showCode = false;
    publish(filename,options_doc_nocode)
    ret=1;

In the above code we are providing the name of the function and format to which the script output has to be stored. The above code is simple and straight forward it says the format of the output file and where that output file has to be stored. whether the source code of the script file has to be written to the output or not.

The following links are the ways of using java code in matlab and convert the matlab file into the java file and java web services.

http://www.mathworks.com/products/javabuilder/
http://www.mathworks.com/help/techdoc/matlab_external/f44062.html
http://blogs.mathworks.com/desktop/2009/07/06/calling-java-from-matlab/

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: