1. Introduction

This document is intended for Techila End-Users using MATLAB as their primary development environment. This document contains minimal information allowing you to run your first MATLAB computations.

For more information about the Techila MATLAB API and walkthroughs of example material, please see the full guide.

2. Setup

Note! In order to complete the configuration, you will need the following:

  • MATLAB

  • MATLAB Compiler

  • C-compiler compatible with your MATLAB Compiler

Please also note that in order to perform the steps described here, you will also need access to Techila SDK.

If you have not downloaded the Techila SDK, please download the plugin package (TechilaSDK.zip) before continuing. The TechilaSDK.zip can be downloaded from the Techila Configuration Wizard, after you have launched the Techila Distributed Computing environment.

  1. Extract the previously downloaded TechilaSDK.zip to your computer, e.g. to your home directory.

    When extracted, the TechilaSDK.zip file will create a directory called techila with the folder structure illustrated in the example screenshot below. In this example, the TechilaSDK.zip file was extracted to C:\.

    matlab1
  2. Launch MATLAB.

  3. Verify that you have the MATLAB Compiler by executing ver in MATLAB and checking the output.

    matlab2
  4. In MATLAB, change your current working directory to techila/lib/Matlab in the Techila SDK.

  5. Execute command the following command in MATLAB:

    installsdk()

    This command updates the MATLAB’s search path to include the Techila SDK’s techila/lib/Matlab path.

    matlab3
  6. Test the network connection to the Techila Server by executing the following command in MATLAB.

    techilainit()

    If the network connection test was successful, the function should return the value 0 as illustrated in the example screenshot below.

    matlab4
  7. Execute the following command in MATLAB and follow the on-screen instructions configure your MATLAB compiler:

    mbuild -setup

    The screenshot below illustrates what the output looks like when Microsoft Windows SDK 7.1 has been configured as the C compiler.

    matlab5

3. Running Your First MATLAB Project in TDCE

The cloudfor helper function included in the Techila SDK can be used to execute computationally intensive for-loop iterations simultaneously in a TDCE environment.

More cloudfor examples can be found in the following chapter of the complete guide.

Note! For the cloudfor function to work, the code must be stored in an m-file. You cannot copy-paste cloudfor loops to the MATLAB Command Window.

To run the code snippet below, place it in an m-file named main.m and run the main() function in MATLAB.

Note! If this is the first MATLAB Project you are running in your TDCE environment, the Project may take up to 1 hour due to initial configuration steps. After the initial Project has been completed, subsequent Projects will be quicker.

function result = main()
loops = 10;
result=zeros(1,10); % Create an empty vector for the result values
cloudfor counter=1:10 % Beginning of the cloudfor-block
%cloudfor('stepsperjob',2)
    result(counter)=counter*counter;
cloudend % End of the cloudfor-block

4. Next Steps

Congratulations! You should have been able to run your first computations in TDCE. Next, you can start modifying your own code to run in TDCE.

The complete MATLAB guide contains additional examples and information about the Techila MATLAB API. This document can be used to reference how to implement various features available in TDCE when modifying your code.