Answered
How a bandpass filter (BP) can be made
Since you apparently are supposed to code it using command-line function calls in a script, and you are limited to an order 5 fi...

4 years ago | 1

Answered
first order differential equation
One approach — syms y(x) x Y Dy = diff(y); Eqn = 2*x*y*Dy+(1+x)*y^2 == exp(x); [VF,Subs] = odeToVectorField(Eqn) odefcn =...

4 years ago | 0

Answered
remove noise from signal
Change: [b,a] = butter(n,Wn); to: [z,p,k] = butter(n,Wn); and eliminate the tf2zp call. Then the filtfilt call should be...

4 years ago | 0

| accepted

Answered
How to plot u(t) - u(t-2) on matlab
If ‘u(t)’ is the unit step (heaviside) function — syms t u(t) = heaviside(t); figure fplot(u(t)-u(t-2), [0 5]) grid xl...

4 years ago | 1

Answered
Optimisation of parameters in coupled ODE
I’m not certain what you’re doing (and 81 parameters seems excessive), however this is the approach I use with ga to solve kinet...

4 years ago | 0

Answered
str2double function multiplies values by 10e12, 10e13 and 10e14 randomly.
Try ssomething like this — data1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1233477/example...

4 years ago | 0

| accepted

Answered
Setting length of output vector for ode45
Choose a vector with more than two elements for ‘tspan’ for example — tspan = linspace(min(time), max(time), N); where ‘time’...

4 years ago | 1

| accepted

Answered
Fix the code calculate PSD
I am not certain what you are doing. The third argument to cpsd is supposed to be a window function, however in your calls to i...

4 years ago | 0

Answered
how to use dataaspectratio in scatterplot?
I doubt that daspect is going to have any effect here. The only option is likely to translate one of the plots by subtracting t...

4 years ago | 0

| accepted

Answered
How to compute number of bit change among consecutive binary numbers?
Use pdist with the 'hamming' distance metric then squareform to create the matrix — b = {'110' '101' '011' '111' '...

4 years ago | 0

Answered
Symbolic Toolbox Solving for Zeros
One approach — range = [-5 5]; syms x; f(x) = sin(3*x); z = dPlotInfo(f, range); disp(z); function [zeros] = dPlotInfo(...

4 years ago | 0

Answered
How do I right pad a numeric data field with invisible characters?
It would help to know more precisely what you want to do. Numeric format dexcriptors can be created as a total numeric field ...

4 years ago | 0

Answered
Differentiation question - How to find out H vs. dH/dt from a list of height and datetime series?
One approach — T = ['01-Jan-2003' '17-Jan-2003' '03-Feb-2003' '20-Feb-2003' '01-Mar-2003' '15-Mar-2003' '04-Apr-2003' '...

4 years ago | 0

| accepted

Answered
Bode plot, plotted with experimental data
If you want to identify a system from experimental data, use the System Identification Toolbox functions, starting with iddata, ...

4 years ago | 1

Answered
How can I delete last two colum in a matrix?
Try something like this — A = rand(7,5) Anew = A(:,1:end-2) .

4 years ago | 0

| accepted

Answered
how to extract y as a function of x
Try something like this — syms x y a b x0 y0 tr sympref('AbbreviateOutput',false); Eqn = (a^2*sin(tr)^2+b^2*cos(tr)^2)*(x-x0...

4 years ago | 0

| accepted

Answered
How to invoke and use GA tool in Matlab R2022b?
If you are doing parameter estimation, this approach will likely work — x = 1:0.1:10; y = 2.5*exp(-(x-5).^2/2)+randn(size(x))...

4 years ago | 0

| accepted

Answered
How to plot a line of zero value on a surface?
Use contour3 to draw the boundary (here a red line with 'LineWidth',5) — LD1 = load(websave('Y','https://www.mathworks.com/m...

4 years ago | 0

| accepted

Answered
I get complex numbers when I manipulate an FFT spectrum
The easiest way to do this is with a bandstop or notch filter in the time domain. If you must do it in the frequency domain, ...

4 years ago | 0

Answered
FUNCTIONS IN GENETIC ALGORITHM
‘Can I apply the Genetic Algorithm to a fitness function that calls other functions?’ Yes. ‘and global variables are a p...

4 years ago | 0

| accepted

Answered
Is it possible to obtain the initial data after "smoothdata" function?
In general, no. Smoothing involves filtering of some sort, and that removes the higher-frequency details of the original sign...

4 years ago | 0

| accepted

Answered
Finding x-intercept in a 2d plot shown below, there are multiple loops I want to find all the values of X at Y=0...Please help..
Something like this should work — %Finding X value with known Y value on plot t = linspace(0, 2*pi, 1000); ...

4 years ago | 0

Answered
I want to delete part of a row in an array but it kept returning an error
This cannot be done with a numeric array, however it can be done with a cell array. The disadvantage is that it must be kept ...

4 years ago | 1

| accepted

Answered
How can I plot 2D surface plot with color bar
It is possible to create a surface plot from it, however it is probably not worth the effort — T1 = readtable('https://www.mat...

4 years ago | 0

| accepted

Answered
How to re-scale an axis
Try something like this — x = linspace(0, 2E6, 2E6); y = sin(2*pi*x/1E6); figure plot(x, y) figure plot(x, y) xt = g...

4 years ago | 0

| accepted

Answered
comparing between two cell arrays
I am not certain what result you want. Try this, and if it works, loop through the elements of ‘A’ and ‘B’ for all the necess...

4 years ago | 0

| accepted

Answered
How I can impliment my objective function inside this GA?
Since ‘objective function’ implies curve fitting, try something like this — x = 1:0.1:10; y = 2.5*exp(-(x-5).^2/2)+randn(size...

4 years ago | 0

| accepted

Answered
How to extract X value given Y value from graph.
%Finding X value with known Y value on plot clc; clear all; close all; x= 0:0.01:5; y= [0.2 0.4 0.7 0.9 1.0] [X, Y] = mesh...

4 years ago | 1

Answered
I need to make the vectors the same length
One option is interp1 — x = 1:9 y1 = randi(9, 1, 5) y1_new = interp1(linspace(min(x), max(x), numel(y1)), y1, linspace(mi...

4 years ago | 0

Answered
Simulate and plot Butterworth filter frequency response using transfer function
If you want to see the frequency response, use the bodeplot function — R = 10; L1 = 10; L2 = 10; C = 1; ...

4 years ago | 1

| accepted

Load more