Here are some new examples and applications that I have added to my website. They try to clarify the use of some instructions and functions in Matlab. I hope you find them useful...

The 3D plot functions intended for plotting meshes and surfaces 'mesh' and 'surf', and their several variants 'meshc', 'meshz', 'surfc', and 'surfl', take multiple optional input arguments, the most simple form being 'mesh(z)' or 'surf(z)', where z represents a matrix. See these examples...

Polynomials are used so commonly in algebra, geometry and math in general that Matlab has special commands to deal with them. The polynomial 2x4 + 3x3 − 10x2 − 11x + 22 is represented in Matlab by the array [2, 3, -10, -11, 22] (coefficients...

We'll demonstrate how to work out polynomial regression in Matlab (also known as polynomial least squares fittings)...

Continue reading "Polynomial Regression in Matlab - easy least squares fitting"

A periodic function repeats its values in regular periods or intervals. We explore codes for square and sawtooth waves without any special toolbox needed...

Continue reading "Periodic Function - some codes without special toolboxes in Matlab"

In this project, we are going to develop a GUI in Matlab to calculate the BMI (body mass index). We are going to introduce the radio button...

We are going to include the concepts in our Derivative function created before, to develop a Matlab function to calculate the gradient of a multidimensional scalar function. The function is going to have the following functionality...

This program calculates a polygon area, using Matlab. You must supply the x and y coordinates of all vertices. Coordinates must be entered in order of successive vertices...

This algorithm performs the t statistic and degrees of freedom for Student’s distribution, in Matlab code. The calculations can be based on any one of these three hypotheses...

Continue reading "T statistic - Student's t-distribution Test in Matlab"

This algorithm (code in Matlab) calculates the number of permutations and combinations of N objects taken D at a time. The full Matlab code is...

Continue reading "Permutations and Combinations - calculate its number in Matlab"

Create your first Scilab 3D Plot with these functions. See about plot3d, meshgrid and others...

How to calculate square feet - see this online converter for feet and inches...

Continue reading "Calculate Square Feet - online spreadsheet"

In this article we’re going to build-up a simple adder. Our adder (by means of relevant callback function s) is going to have two ‘edit text’ components, two ‘static text’ components, and one ‘push button’ element.

In this example, we study the Matlab plot 'stem' instruction to illustrate functions. It draws vertical lines (with little circles on the tip) proportional to the value of the function at that horizontal value...

Continue reading "Matlab Plot - using stems (vertical lines) for discrete functions"

The Smith chart is a graphical tool designed for engineers specializing in RF to solve problems related to transmission lines and matching circuits....

Recursion is a kind of tricky and smart construction which allows a function to call itself. The Matlab programming language supports it...

Continue reading "Recursion - a conceptual example in Matlab"

How a nodal analysis can let you find voltages in an electrical circuit. Use this math software to work out the arithmetic operations...

Continue reading "Nodal Analysis - learn about KCL and solve it easily with Matlab"

We’ll work with exponential regression in a curve fitting in Matlab. The following three methods find the coefficients of an equation for an exp. curve...

We show how curve fitting is done in Scilab. We show the polyfit and polyval functions equivalent to Matlab's...

Basic Scilab commands and data types are introduced with basic examples, see these descriptions...