Answered
Problem reading a binary file in MATLAB
Hi, Here is how you should write your data into a binary file and read it from the binary file. % Writing in abinary file ...

7 years ago | 0

Answered
multi bar labeling plot
Hi Ali, Here is a simple solution to your problem: A= randi([15, 25], 13, 3); % Insert your data here H = bar(A); shg H(...

7 years ago | 0

Answered
How can I solve for coupled differential equations?
Hi Brandon, An easy and fast way of solving this coupled system is to use ODEx (ode23, ode45, ode113, etc) solvers. Here is one...

7 years ago | 0

Answered
Single axis scaling of coneplot cones
In this case, daspect(ratio) would help to resolve this caling factor issue before plotting.

7 years ago | 0

Answered
representation of chromosomes in genetic programming?
GA toolbox of matlab would be a good starting point to understand this issue by working in MATLAB environment and GUI tools.

7 years ago | 0

Answered
Fourier Transform
delta_t=0.001; % Sampling time fs=1/delta_t; % Sampling frequency t = 0:delta_t:pi;% Time space N = 2048; % Block...

7 years ago | 0

Answered
How can I control my setteling time in a PID system?
Hi, There is a Simulink block called PID() for open and closed loop systems. It can be tuned autmatically w.r.t. user specifi...

7 years ago | 0

Answered
Y=sqrt((A^2*X^2+B^2*X^2)/(C+D^2*X^2))
Hi, Here are three solutions with lsqcurverfit and non-linear lsqfit. % Use of LSQCURVEFIT from the optimization toolbox x ...

7 years ago | 1

| accepted

Answered
Reading a text file and creating arrays
Hi Benjamin, Here is the solution with respect to the given data (Bdata.txt) copied (and one more set just copied) from your ...

7 years ago | 1

Answered
Count number of elements in a matrix more or less than given numbers
Hi Meg, Here are two simple solutions to your problem: % Given matrix: A =[ 1 23; 2 9; 3 55; 4 ...

7 years ago | 0

Answered
How to generate table
Hi, Here are two different solutions giving the same table output: % Solution 1 TT= { 'JAK' 23 'KMT' 56 8...

7 years ago | 0

Answered
Digital filter design
%% Saw-tooth signal generation: fs=25; t=0:1/fs:13; % Saw-tooth like signal S(t) is generated: S=sawtooth(t); % Add White Ga...

7 years ago | 0

Answered
How to adjust the FminSearch step?
Hi, Set tolerances in optimset and include in in your fminsearch(..., ..., OPTsN) : OPTs = optimset('TolFun', 1e-15); OPTsN =...

7 years ago | 0

Answered
how can i learn simulation from begining?
Hi, It is a big question. A simple and basic answer is: start with a simple and well understood problem of yours. And you enl...

7 years ago | 0

| accepted

Answered
4D plot in Matlab
Hi Manisha, Based on your given data sets (assuming that some large parts of data belong to [A] as shown below from XY). So y...

7 years ago | 0

Answered
How can I write a loop that vertically concatenates a series of sequentially named 1D arrays into a single 2D array
Hi Shane, Here is one of the quick and easy script to use to generate an array of any size w.r.t. a user entry for initial an...

7 years ago | 1

| accepted

Answered
Sorting points of image
Hi, What you are trying to find out where the white pixels are residing, right?! % This locates all white pixels accurately ...

7 years ago | 0

Answered
Getting different results between Matlab integration and Maple?
Hi Zeyad, Here is an alternative function quad() with its set tolerance to compute integration that changes the solutution a...

7 years ago | 0

| accepted

Answered
How to Convert integer numbers to RGB values
Hi Anupam, If you'd like to generate/create RGB values like for images, then it is quite straightforward. Let's create 25 - ...

7 years ago | 0

Answered
How to use a variable from a script in another script
Hi Isaac, An alternative option for your case is to use assignin() within your function file to take out whichever variable/v...

7 years ago | 0

| accepted

Answered
Drop-down menu in simulink
Hi, One idea of creating drop-down option for input constant is to have this block under a subsystem that have to be converte...

7 years ago | 1

| accepted

Answered
Add figure to .txt file using fprintf
Hi Justin, You can try this script with dlmwrite() for RGB images in jpg/jpeg/png... etc: clearvars; close all MM = imread...

7 years ago | 0

| accepted

Answered
cruise control model of car by simulink giving synatx error
This is a really nice model and works very well that can be a very good model for learning purposes for many.

7 years ago | 0

Answered
Problem plotting bode for a 2nd order system
Hi Francois, I have tested and simulated your example and it works as it has to w.r.t. the values of M1, K1, C1. In fact, for...

7 years ago | 0

| accepted

Answered
How to use workspace variables in simulink's matlab function?
Hi, Here is a quick and easy solution. A small trick to make MATLAB Fcn block of Simulink to accept the data from the structu...

7 years ago | 0

Answered
Add figure to .txt file using fprintf
Hi, It is possible to do it. (1) If you shall save your plot as *.jpg, jpeg, *.tiff, *.... etc. image file; (2) you shal...

7 years ago | 0

Answered
Animated plot with trajectory points
Hi, You have almost done all the work except for some small points. Here is the finalized one: x = [0.829848791287224;0.9483...

7 years ago | 0

| accepted

Answered
Using differential equations of acceleration how would I plot a trajectory?
Hi Alexander, What you've depicted is all appropriate. Just a brief recap what you have stated and how to implement in MATLAB...

7 years ago | 0

| accepted

Answered
lsim not working with a single pole system
Hi, Everything you have done is ok except for one small (but crucial point): y = sin(f*x); has to be y = sin(2*pi*f*x); Th...

7 years ago | 0

Answered
NaN ouput on using string2double function for an OCR-ed output string
Hi, Usually when you import/read data from the Excel spreadsheet, empty cells/boxes of the Excel Spreadsheet from where you a...

7 years ago | 0

Load more