Software Listing of Author : "Nassim Khaled"
- crank-slider mechanism
- License: Shareware
- Price:


This m-script shows a simple simulation for the crank-slider mechanism of the piston.
- Publisher: Nassim Khaled
- Date Released: 06-03-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Derivative-based Optimization
- License: Freeware
- Price: 0.00


This folder contains a word document (optimization_problem_wth_solution.doc) that contains a description for an optimization problem along with its solution. The folder contains two m-script file that contain the solution for the Gradient_Descent_minimum and Gradient_Descent_maximum problems included in the word document. The algorithm for the gradient descent is included in the m-script files. For more information, you could go to wikipedia. You don't need the optimization toolbox to run the script.
- Publisher: Nassim Khaled
- Date Released: 26-01-2013
- Download Size: 819 KB
- Download
- Platform: Matlab, Scripts
- Draw two figures with separate x and y axis
- License: Shareware
- Price:


This script plots two sets of 1D data on the same figure with two separate axis and with the same gridding. The code also checks if the x-axis data are the same, if the x-axis data are not the same, it draws an additional x-axis on the top of the figure. The two sets of data with their axes are drawn with two colors for ease of reading
- Publisher: Nassim Khaled
- Date Released: 22-03-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Extract data from an existing .fig file
- License: Shareware
- Price:


This is a simple code to extract data from an existing matlab 2D or 3D figure.
- Publisher: Nassim Khaled
- Date Released: 08-02-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- General Purpose Controller
- License: Freeware
- Price: 0.00


This is a general purpose controller that I have built using the Fuzzy Logic Rules. You don't need to have any mathematical background in fuzzy logic to run this model. You don't need to have fuzzy logic toolbox to run it aswell. It contains both linear and a nonlinear examples. It also has a read me that explains how to make use of it to your own benefit.
- Publisher: Nassim Khaled
- Date Released: 09-05-2013
- Download Size: 20 KB
- Download
- Platform: Matlab, Scripts
- Grab 2D points
- License: Shareware
- Price:


% This code is used to digitize figures that you find in publications, journals, or simply scanned reports or documents by clicking on the desired points using the mouse. % You can use it to pick [x,y] points by clicking on the original scanned plot. % To run, simply type: Nassim_Grabit0 % and then follow the instructions % % % % Notes: % 1- Plots or figures should be of jpg, png, bmp or any other format that is % acceptable by matlab and in the same directory as these m-files you are using. % 2- You don't have to select the points in increasing or decreasing % order. Click wherever you want on the plot. I have written a small code % to sort the vectors in ascending order % 3- The [x,y] data points will be saved in GRABBED.mat. Load % GRABBED.mat and the first column of GRABBED will be your absisca points, the second % are the...
- Publisher: Nassim Khaled
- Date Released: 19-03-2013
- Download Size: 870 KB
- Download
- Platform: Matlab, Scripts
- gui calculator based on gaussian quadrature inegration
- License: Shareware
- Price:


This is a simple gui application that used gaussian quadrature inegration based on index=1-3. It can be easily extended to higher order of indices for better accuracy. For more information visit: http://en.wikipedia.org/wiki/Gaussian_quadrature
- Publisher: Nassim Khaled
- Date Released: 20-06-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- gui_simulink_scope
- License: Shareware
- Price:


This file contains a guide_simulink_sfunction interface. It is a fairly easy and simple application. It was mainly created as a reply for a question from one of the students on 'how to display the simulink results in real time in a gui interface, outside the boundries of simulink?' the gui(simulink_gui_interface) is a simple one. It calls the simulink model(simulink_model.mdl), which in return uses an s-function(sfun.m) to plot the data. I tried to make this example as simple as possible so that more people would benefit from this application. One more important observation, if you run the simulink model (simulink_model.mdl) from simulink, it will take more time than running the simulink model from the interface itself (simulink_gui_interface)!! To run, just type in the Matlab workspace: simulink_gui_interface Submitted by Nassim...
- Publisher: Nassim Khaled
- Date Released: 02-04-2013
- Download Size: 20 KB
- Download
- Platform: Matlab, Scripts
- inside triangle
- License: Shareware
- Price:


%inside_triangle is used to check if a point P is inside %the triangle P1P2P3 or not. % %Inputs: P, P1, P2 and P3 are vectors of length 2 or three of the % form [x y z] or [x y] % %Output: True %True=1 => P is on or inside P1P2P3 %True=0 => P is outside P1P2P3 % %Example: %True=inside_triangle([0.5 0.5],[0 0],[0 2],[2 0]); % %The following algorithm is implemented % If P is ON or INSIDE the triangle % % Area(PP1P2) + Area(PP2P3) + Area(PP3P1) = Area(P1P2P3) % % If P is OUTSIDE then, % % Area(PP1P2) + Area(PP2P3) + Area(PP3P1) > Area(P1P2P3) % % Area of a triangle can be found using the determinant: % % Area = abs(1/2 * |x1 y1 1| ) % |x2 y2 1| % |x3 y3 1| %
- Publisher: Nassim Khaled
- Date Released: 26-06-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Mapping of angles from [-pi,pi] to [0,2*pi]
- License: Shareware
- Price:


This Simulink file contains a subsystem that performs the on-to-one mapping from [-pi,pi] to [0,2*pi]. The file contains four different cases to illustrate the various possibilities.
- Publisher: Nassim Khaled
- Date Released: 18-04-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Position of a point and a straight line or segment
- License: Shareware
- Price:


Position determines the relative position of a planar point C with respect to a planar segment joining A and B. This is not intended for 3D points. Pos=0 =>the point C is collinear with A and B Pos=1=>the point C is above the segment Pos=-1=>the point C is below the segment Example A=[0 0 0]; B=[1 1 0]; C=[1 0 0]; Pos=Position(B,A,C) Since C is below AB then Pos=-1 Note: in case of 2D points, you still have to include the z-ordinate, i.e if you have a point S=[1 2], add a zero to get S=[1 2 0], and use the same procedure as the above example
- Publisher: Nassim Khaled
- Date Released: 20-06-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- rand_extended computes a random number in the interval [a,b]
- License: Shareware
- Price:


rand_extended computes a random number in the interval [a,b] It is basically an extended version of the command rand Inputs: a: the lower bound of the interval b: the upper bound of the interval m,n(optional): dimensions of the matrix of random numbers to be generated Outputs: M: random number/matrix in the interval [a,b]
- Publisher: Nassim Khaled
- Date Released: 19-05-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- saturation function
- License: Freeware
- Price: 0.00


This file contains a funtion (mfile) and a simulink block. They both give the approximation of the saturation of a function between the values [-1,1]. The main advantage and purpose of designing this simple yet powerful function is to obtain a smooth funtion that has a continous derivative. It can be easily adjusted to different lower and upper bounds by alterning the value "5" in the formula. Play around with it as you desire and as suitable to your application. It can be used in control applications like sliding mode control (that uses the saturation) and other control schemes.
- Publisher: Nassim Khaled
- Date Released: 17-03-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- simulink introduction video
- License: Freeware
- Price: 0.00


This is a video recording of an introduction crash course for Simulink. It contains the video plus the Simulink file used in the lecture. The example contains basic building blocks of Simulink such as the step function, the scope, the gain, the transfer function and the gain. The lecturer shows how to drop the blocks and change some important configuration parameters for better accuracy. He also shows how to change the parameters of the scope to be able to transfer data from Simulink to Matlab's workspace.
- Publisher: Nassim Khaled
- Date Released: 03-04-2013
- Download Size: 10711 KB
- Download
- Platform: Matlab, Scripts
- Sugeno-Takagi-like fuzzy controller
- License: Freeware
- Price: 0.00


I have built the rules in simulink and not using the fuzzy logic toolbox.This controller is a two input one output fuzzy controller The first input is the error=x. The second input is the error_dot=y(time derivative of the error) The output of the fuzzy controller is the CHANGE in the control action and NOT the control action.
- Publisher: Nassim Khaled
- Date Released: 15-04-2013
- Download Size: 143 KB
- Download
- Platform: Matlab, Scripts
- Vibration from frames
- License: Shareware
- Price:


this can be used to extract the frequency of a simple harmonic vibrations from frames vibration_from_images.m is a function that can be used to extract the frequency of a simple harmonic vertical vibration. The mass has to have a horizontal landmark. The included video (Video.avi) has been recorded as an illustrative example. vide02pic.m (shared by Shiquan Wang in Matlab central) was used to extract the individual frames. Hough_Grd.m(shared by Tao Peng in Matlab central) was used to detect the lines in the image. Only the horizontal lines in the image has been kept(by keeping lines with small slopes).
- Publisher: Nassim Khaled
- Date Released: 12-06-2013
- Download Size: 1567 KB
- Download
- Platform: Matlab, Scripts
- Virtual Reality Recording
- License: Shareware
- Price:


This is a virtual reality recording created using simulink. This is a recording to one of the examples included in the book "Virtual Reality for Matlab(R) and Simulink(R) Users": http://www.springer.com/computer/information+systems+and+applications/book/978-1-4471-2329-3 The codes and movies for the book are available for free download at: http://extras.springer.com/2012/978-1-4471-2329-3
- Publisher: Nassim Khaled
- Date Released: 12-04-2013
- Download Size: 8643 KB
- Download
- Platform: Matlab, Scripts