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

Sunday, August 28, 2016

MATLAB Programming Tips Part 1



MATLAB program (functions and scripts) are stored as script file(.m files). This type of file contains MATLAB commands, so running it is equivalent to typing all the commands—one at a time—at the Command window prompt. You can run the file by typing its name at the Command window. Matlab Programming Tips Part 1 from Shameer Ahmed Koya Both functions and scripts are stored in .m files —Type up a bunch of commands and save as filename.m —Type...

Tuesday, August 23, 2016

Polynomials and Curve Fitting in MATLAB



MATLAB provides a number of functions for the manipulation of polynomials. Polynomials are defined in MATLAB as row vectors made up of the coefficients of the polynomial, whose dimension is n+1, n being the degree of the polynomial. Polynomials in MATLAB vector must include all polynomial coefficients, even those that are zero. MATLAB provides the function polyval to evaluate polynomials. MATLAB does not provide a direct function for adding or...

Friday, August 5, 2016

Working with Excel files in MATLAB - Part 2



Read part 1 here. We will discuss few more functions to deal with Excel files. xlswrite ( ) – Write to Microsoft Excel spreadsheet file xlswrite is a simple function to write data to an excel worksheet. The syntax is similar to the xlsread function xlswrtie(‘filename’, A, ‘worksheet’, ‘range’) The function write the values in the array A to the specified range of cells in the specified worksheet of the excel file. The array may be a numeric...