Matlab

IMPORT, EXPORT DATA IN MATLAB AND PLOTTING

IMPORTING DATA:

Where in Matlab importing data is defined as obtaining data from an external file. By using the importing data function we obtain data of different formats with various functions. There are four import functions in Matlab that are described as follows.

C= importdata (format): data from the file named as format is loaded in to the array C.

C=importdata (‘-pastespecial’): loading of records from the system clipboard in place of the document.

C= importdata (___, delimiterIn, headerlinesIn): In this function data is loaded from ASCll file, or clipboard, while the numerical reading starts from line headerlinesIn+1.

C= importdata (___, delimiterIn): In order to separate the column ASCII file or clipboard data we can use delimiterIn.

EXPORT DATA:

In matlab export data means write data in to the file. In matlab there various export data functions, Rectangular, delimited ASCII data file from an array. Diary (or log) document of keystrokes and the ensuing textual content output. Besides from the above there are another way to export a numeric array as a delimited ASCll data file:

With the help of save function we can specify the -ASCII qualifier using the dlmwrite function.

PLOTTING:

In order to plot a graph we use a graph function, to take the following steps:

To draw a graph we should outline the X values from the desired variety for which the graph is plotted.

Let us define the function by considering z=f(x)

Now let’s call plot command, as plot(x,y)

Let us plot simple function y=x for the value in the range of 0 to 200 with an increment in the value of 10.

X= [0:10:200];

z=x;

Plot(x, y)

ADDING TITLE, LABELS AND GRID LINES ON THE GRAPH:

In order to adjust the value in the graph we consider title labels and grid lines. The x label and y label instructions generate labels alongside x-axis and y-axis. The name command permits you to position a name at the graph. The grid on command permits you to position the grid traces at the graph.

Rajeshwari Chiluveru

Share
Published by
Rajeshwari Chiluveru

Recent Posts

Google Spam Update 2025: Impact, Recovery Guide & SpamBrain Explained

Google released a spam update on 26th of August 2025 and this is affecting a…

2 weeks ago

Google Experiments with Black Sitelink Colors instead of Blue

Google keeps on testing google search display all the time and this time we are…

1 year ago

What are Template Tags in WordPress? How to Use Template Tags

In wordpress if you are developing new or custom wordpress theme or wordpress plugin then…

2 years ago

Google Search Indexing Issues Started on 31st January to February 2024

If you are experiencing indexing issues of your website then you are not alone and…

2 years ago

Create QR Code for Pages & Post using Plugin in WordPress

On your wordpress website if you want to generate qr code for pages and posts…

2 years ago

Add Google Search Console HTML File Upload on WordPress

If you are trying to verify your WordPress website with google search console with html…

2 years ago