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

Friday, July 22, 2016

Working with Excel files in MATLAB - Part 1



MATLAB have many builtin functions to work with Excel files. In this post, we will discuss some of the common functions to work with Excel files.  It is easy to interact with an excel file using xlswrite and xlsread commands. First we will make an sample excel file test.xlsx which contain grades of students in a class. xlsread ( ) - Read Microsoft Excel spreadsheet file The xlsread function reads data from the first worksheet of a Microsoft...

Friday, July 15, 2016

Working with Text files in MATLAB - Part 2



In part one we discussed about basic functions to deal with text files. Now we will discuss more function to read from and write to different types of text files. csvwrite( )  - Write comma-separated value file csvwrite is the basic function in MATLAB to write data to a file as comma-separated values. It has only limited options to write numeric data to the file. The syntax is: csvwrite(filename, C) The function writes matrix C into the...

Saturday, July 2, 2016

Working with Text files in MATLAB - Part 1



MATLAB can import text files both interactively and programmatically. Import Tool used to import data interactively. The Import Tool supports text files, including those with the extensions .txt, .dat, .csv, .asc, .tab, and .dlm. Data in these files can be a combination of numeric and nonnumeric text, and can be delimited by one or more characters. There are many inbuilt functions to import and export data from and to the text files programmatically....