Found 33676 Articles for Programming

Golang Program to Implement Median of Medians

Akhil Sharma
Updated on 07-Sep-2023 16:49:04

488 Views

The median is the element in the middle of a dataset when the dataset is sorted. The Median of Medians algorithm is a powerful technique that is used to find out the median element in an unsorted array. In this article, we will implement median of medians algorithm in golanguage, using two methods like the recursive method and the iterative method. Explanation The Median of Medians algorithm, an efficient technique for determining the median value in an unsorted array. It introduces two distinct methods: the recursive approach and the iterative approach. Recursive Method: The findMedianRecursive function is introduced to ... Read More

Golang Program to Implement Rabin Karp

Akhil Sharma
Updated on 07-Sep-2023 16:47:10

231 Views

The Rabin−Karp algorithm in Golang is a powerful string searching algorithm used to efficiently locate a pattern within a larger text. In this article, we need to implement Rabin Karp algorithm in golanguage that will enable efficient pattern matching and showcasing the flexibility of this algorithm in Golang. We can use methods like the single function approach as well as using the modular approach. Pattern Matching Let us assume we have the text: “ABCABCDABCABC” and the pattern “ABC”, so by implement Rabin Karp algorithm in golanguage we can find out how many times and where this pattern repeat itself in ... Read More

Handle Object Behavior in MATLAB

Manish Kumar Saini
Updated on 07-Sep-2023 13:56:30

141 Views

MATLAB is an object-oriented programming (OOP) language that allows us to create objects and define their behavior. In MATLAB, there is a data type called 'Handle' which is used to point an object. Handles in MATLAB also allows us to pass a function as an input argument of some other function. In MATLAB programming, the handles are passed by reference instead of value. Therefore, when any change is made in the object's property, it will reflect across all the references. The use of handles in a MATLAB program makes it more memory efficient because it does not require copying ... Read More

Gray Level Co-occurrence Matrix in MATLAB

Manish Kumar Saini
Updated on 07-Sep-2023 13:59:10

352 Views

In digital image processing, the gray level co-occurrence matrix, also known as GLCM, is a statistical method employed for holding the spatial relationship between pairs of pixels in a digital image. The gray level co-occurrence is a method of representing the way in which different combinations of pixel intensities are arranged within the image. It is mainly used to specify the texture property of an image and provide the information about the patterns, variations, and structures occurring in the pixel values within spatial regions of the image. What is Gray Level Co-Occurrence Matrix? As stated above, the gray level co-occurrence ... Read More

Gray Scale to Pseudo Color Transformation in MATLAB

Manish Kumar Saini
Updated on 07-Sep-2023 13:49:45

501 Views

MATLAB provides an easy and efficient way of processing images. In this tutorial, we will explore how to perform gray scale to pseudo color transformation in MATLAB. In MATLAB, the gray scale to pseudo color transformation is an image processing technique which is used to create a visually appealing image by mapping the intensity values of the gray scale image to a specific color. If we want to convert a gray scale image to a pseudo color image using MATLAB, then we can use a built-in function in MATLAB, which is ‘colormap’ and a color map matrix. Now, let us ... Read More

Function with Variable Number of Input Arguments in MATLAB

Manish Kumar Saini
Updated on 07-Sep-2023 13:45:59

273 Views

MATLAB is a high-level programming language that has capability to define a function that can accept a variable number of input arguments. In MATLAB, there is no need of defining any additional function or array to define a function with variable number of input arguments. How to Create a Function with Variable Number of Input Arguments in MATLAB? In MATLAB, when the keyword "varargin" is used in the function definition statement then it enables the function to take any number of input arguments. The "varargin" keyword is composed of "VARiable ARGument INput". It is important to note that the keyword ... Read More

Forward and Inverse Fourier Transform of an Image in MATLAB

Manish Kumar Saini
Updated on 07-Sep-2023 13:43:38

754 Views

In mathematics, the Fourier transform is a mathematical tool used for converting a function or signal from the time domain to the frequency domain. It is widely used in the field of signal processing, communication, image processing and analysis, etc. Before proceed to find the forward and inverse Fourier transformer of an image using MATLAB, let us get a brief overview of Fourier transform and its inverse. Forward Fourier Transform Fourier transform or Forward Fourier transform is a mathematical operation that is used to transform a signal from the time domain into the frequency domain. Therefore, the forward Fourier transform ... Read More

Randomly Shuffle Rows in MATLAB Matrix

Manish Kumar Saini
Updated on 07-Sep-2023 13:58:13

2K+ Views

MATLAB is a great tool to process matrices. It provides a large number built-in functions and processing methods that we can use to manipulate our matrices just by writing a small piece of MATLAB codes. Such an operation that we can perform on matrices in MATLAB is random shuffling of rows of a matrix. In this tutorial, I will explain how you can randomly shuffle rows of a matrix using MATLAB. Randomly Shuffle Rows of a Matrix in MATLAB MATLAB is a complete solution to manipulate matrices using computers. In MATLAB, we can very easily shuffle rows of a matrix ... Read More

How to Create an Image Component in MATLAB?

Manish Kumar Saini
Updated on 07-Sep-2023 13:39:39

178 Views

In MATLAB, we can create various types of GUI components like EditField, buttons, hyperlink, image, etc. In this tutorial, I will explain how can you create an image component in MATLAB programming. But before that let us first get an overview of image component in MATLAB. What is Image Component in MATLAB? In MATLAB, Image Component is a GUI (Graphical User Interface) component used to show an image in a MATLAB application. This component is widely used in applications where it is required to handle images like in image processing and analysis. To create an image component, MATLAB provides a ... Read More

How to Append Data to a File in MATLAB?

Manish Kumar Saini
Updated on 07-Sep-2023 13:24:41

2K+ Views

In MATLAB, appending is nothing but the process of adding data to a text file which already exists in the memory or workspace. In MATLAB, there is a built-in function 'fprintf' which is used to append or add data to a file. The 'fprintf' function allows users to add or writer formatted data to a text file. By default, this function adds the data to the end of the text file. Let us now see the step-by-step process to append data to a file in MATLAB. How to Append Data to a File? The step-by-step process to append ... Read More

Advertisements