MATLAB Articles

Page 4 of 13

How to reverse a number in MATLAB?

Manish Kumar Saini
Manish Kumar Saini
Updated on 09-Oct-2023 940 Views

In MATLAB, there are various methods and functions for reversing a given number. In this tutorial, I will explain all these methods one-by-one with the help of examples. Reverse a Number Using "fliplr" Function in MATLAB The "fliplr" is a built-in function in MATLAB that we can use to reverse a given number. Syntax reversed_num = fliplr(number); Here, the "number" must be a string. Here are the steps involved in reversing a given number using the "fliplr" function in MATLAB. Step (1) − Input the number. Step (2) − Convert the input number to a string. For ...

Read More

How to remove spaces in a string in MATLAB?

Manish Kumar Saini
Manish Kumar Saini
Updated on 09-Oct-2023 776 Views

MATLAB provides various methods and functions to remove spaces in a string. In this tutorial, we will cover the commonly used methods for removing extra spaces in a string. So, let’s start. Remove White Space in a String Using "isspace" Function In MATLAB, the "isspace" function is a built-in function that is used to determine and remove the ASCII white space present in a string. Syntax string_without_space = isspace('input_string'); Example Let us take an example in MATLAB programming to use this function to remove white spaces in a string. % MATLAB code to remove white space from ...

Read More

How to Import Data from a CSV File with Numeric Values and Texts into MATLAB Workspace?

Manish Kumar Saini
Manish Kumar Saini
Updated on 06-Oct-2023 647 Views

CSV or Comma Separated Values is a file format that can store numeric and text values. The most important characteristic of a CSV file is that it allows to exchange the data among a variety of sources. MATLAB is a powerful tool that provides a large number of built-in functions to perform various operations. It provides the following two functions that enable the users to import data with numeric and text values from a CSV file into the MATLAB workspace. readtable() importdata() In this tutorial, I will show you the process of importing data from a CSV file ...

Read More

How to remove decimal in MATLAB?

Manish Kumar Saini
Manish Kumar Saini
Updated on 06-Oct-2023 2K+ Views

In mathematics, there are several types of numeric values such as integers (having no fractional part), floating point numbers (having fractional parts separated by a decimal), and more. In some data analysis and other computational applications, we are given floating point numbers that contain a decimal part, i.e., digits after a decimal point. But we require only integers. Hence, if you are using MATLAB as your data processing tool, then you can use it to remove decimals present in the given number. This tutorial is primarily meant for explaining the different methods of removing decimals from a given number using ...

Read More

How to Read Text File Backwards Using MATLAB?

Manish Kumar Saini
Manish Kumar Saini
Updated on 06-Oct-2023 345 Views

In MATLAB, reading a text file backwards involves reversing the order of the lines written in the file. We can use MATLAB to reverse the order and read the text file backwards. For this, MATLAB provides various methods using different functions and algorithms. In this tutorial, I will explain the commonly used methods to read a text file backward using MATLAB. Create a Text File in MATLAB In MATLAB, we can create a text file using the built-in functions "fopen" and "fprintf". Example The following example demonstrates the process of creating a text in MATLAB. % MATLAB code to ...

Read More

How to Read an Image File in MATLAB?

Manish Kumar Saini
Manish Kumar Saini
Updated on 06-Oct-2023 394 Views

Reading an image file is the first step in any digital image processing task. In MATLAB, reading an image file means the process of inputting or loading the digital image into the MATLAB workspace and store it in a variable. Let us now understand the process of reading an image file in MATLAB with the help of examples. Read an Image File in MATLAB In MATLAB, there is a built-in function named "imread" in the function library that is used to read an image file. Syntax img = imread(imageFilePath); Here, "img" is a variable to store the input ...

Read More

How to Randomly Shuffle Columns in Matrix in MATLAB?

Manish Kumar Saini
Manish Kumar Saini
Updated on 06-Oct-2023 1K+ Views

MATLAB is an efficient tool to process and manipulate matrices. We can use it to shuffle the columns in a matrix. For this, MATLAB provides built-in functions that can be used together to shuffle the columns in a matrix. In this tutorial, I will explain how you can randomly shuffle columns in a matrix using MATLAB. How to Random Shuffle Columns of Matrix Using MATLAB? MATLAB provides some built-in functions that we can use to shuffle the columns in a matrix. We have to follow the steps given below to shuffle the columns in a matrix using MATLAB. Step ...

Read More

How to Perform Random Pseudo Coloring in Grayscale Image Using MATLAB?

Manish Kumar Saini
Manish Kumar Saini
Updated on 06-Oct-2023 790 Views

In digital image processing, random pseudo coloring is a technique in which pixels of a grayscale image are assigned a random color. In this tutorial, I am going to explain the process of performing random pseudo coloring in a grayscale image using MATLAB. What is Random Pseudo Coloring in Grayscale Image? In digital image processing, "random pseudo coloring" is a way of converting a gray scale image to a random colored image. In this technique, the intensity value of each pixel of the gray scale image is assigned a random color value. Random pseudo coloring in grayscale image is widely ...

Read More

How to Perform Contrast Enhancement of Color Image in MATLAB?

Manish Kumar Saini
Manish Kumar Saini
Updated on 06-Oct-2023 645 Views

As we know, MATLAB is a powerful to perform image processing and signal processing. We can use it to alter different parameters of an image like brightness, contrast, saturation, and more. In this article, I will explain how we can perform contrast enhancement of a color image using MATLAB. What is a Contrast Enhancement? In digital image processing, the process of improving the colors and visual quality of an image is called contrast enhancement. This technique improves the quality of an image by changing the brightness and color concentration among different regions of the image. Contrast enhancement is used ...

Read More

How to Iterate through each element in N-Dimensional matrix in MATLAB?

Manish Kumar Saini
Manish Kumar Saini
Updated on 06-Oct-2023 1K+ Views

MATLAB is a powerful tool to perform various operations on matrices. In the case of matrices, iterating through elements of a matrix is one of the common operations used to perform various other matrix operations such as finding sum of all elements of a matrix, finding maximum and minimum values in a matrix, and more. In this article, I will explain how to iterate through elements in an N-dimensional matrix in MATLAB. Iterating Through Elements of a Matrix In a matrix, iterating through each element means visiting and processing every value present within the matrix. An N-dimensional matrix is one ...

Read More
Showing 31–40 of 124 articles
« Prev 1 2 3 4 5 6 13 Next »
Advertisements