Electrical Engineering Tutorial

A blog to help electrical engineers and students to learn electrical engineering topics. Basic Electrical Engineering, Power Systems, Electrical Machines, tec.. Now special course on MATLAB for Beginners.

Class

Class

Thursday, January 23, 2020

Methods to Improve the Calculation Speed of MATLAB Programs - Part 2



Improving Performance of the Code MATLAB programs are interpreted. Hence large MATLAB programs will take a long time to execute. The power of MATLAB is realized with its extensive set of libraries which are compiled or are carefully coded in MATLAB to utilize 'vectorization'. The concept of vectorization will help to write efficient MATLAB code. The speed of a numerical algorithm in MATLAB is very sensitive to whether or not vectorized operations are used. This section presents some basic considerations to writing efficient MATLAB routines....

Wednesday, February 22, 2017

Methods to Improve the Calculation Speed of MATLAB Programs - Part 1



Introduction Speed of execution of code is an important issue for all coders. In this lecture we will discuss some programming practices to improve the performance of MATLAB code. Analyzing Performance of the Code  MATLAB has some built is tools to help the coder to analyse the performance of his code. The two main tools are The M-file Profiler graphical user interface and the stopwatch timer. These tools help the coder to check information...

Sunday, January 15, 2017

User Defined Functions in MATLAB Part-4



Function Function, Local Function, and Private Function Function Function A MATLAB function that accepts another function as an input is called a function function. Function handles are used for passing functions to function functions. Syntax for function function is same as simple functions, but one or more input arguments will be function handles. Local function - Sub Function Multiple functions within one function file is called local...

Wednesday, January 4, 2017

Anonymous and Inline Functions in MATLAB



Anonymous Functions MATLAB's anonymous functions provide an easy way to specify a function. An anonymous function is a function defined without using a separate function file. It is a MATLAB feature that lets you define a mathematical expression of one or more inputs and either assign that expression to a function. This method is good for relatively simple functions that will not be used that often and that can be written in a single...

Monday, December 26, 2016

User Defined Functions in MATLAB Part -2



Previous post we discussed what is a user defined function in MATLAB. This lecture we will discuss how to define a function and how to call the function in a script. Components of a function is discussed in the previous lecture. The first statement in a function must be function definition.The basic syntax of a function definition is: function[a, b, c]= basicmath(x,y) Basically a function accepts an input vector, perform the operation,...