Matlab Archive

How to plot a function in Matlab

If you have chosen to use Matlab to plot a function today, and this happens to be the first time you want to do so, here area quick look at how you can instruct Matlab to plot your function. There are many online systems allowing you to

A stability Matlab code

If you have ever worked with numerical methods you will know that a major issue with using these methods is not only the exactness of the method but most time, we struggle too with stability of each of the methods. In this post I am simply going

Runge kutta Matlab code

This is an exercise which is solved just for the purpose of comparing two numeral methods and see which one of them is more accurate. Here we will be using Matlab to solve the equations with two different methods, which are: Second order Runge Kutta method and

How to plot a circle in Matlab

Here is  how to plot a circle in Matlab Plot the unity circle in Matlab Code Angles=(0,2*pi,100); plot(cos(angles), sin(angles)) Plot a circle in Matlab with a given radius Angles=(0,2*pi,100); plot(9*cos(angles), 9*sin(angles))

Euler VS Runge kutta – Circle – Matlab code

In the context of this exercise, lets suppose having the two dependent following function: With initial conditions The equation of a circle look like the following where the r is a constant. If we add our equations at 0, the following will be true We are now

How to design a Buck converter in Matlab

A Buck Converter is a DC – DC step down voltage converter (can also be considered like step up current converter) . Here is how you can use Matlab to simulate a Buck converter (Note: In this post, we will consider switches as ideal) In order to

RLC simulation in Matlab using Euler method

Here is a comparison between the Implicit Euler Method and the Explicit Euler method on a given RLC circuit. We will be using the two methods stated above to model the variation of the current in the circuitry below. RLC simulation in Matlab We consider the capacitor

Free fall – Modeling using Matlab

In this post, we will simulate the fall of an object dropped from a certain height in air. We will be using some numerical technique to find the time at which the speed of the object stop changing and to find out if this speed is reached