Answered
function to find max values for intervals
Try this: x = sf; % Set ‘x’ = ‘sf’ collen = 605; ...

7 years ago | 0

| accepted

Answered
How to solve an equation that is using the function min()
The Symbolic Math Toolbox is not likely to be able to do what you want. Try this: P = [1,2,3,2,1]; C = [3,4,5,5,4]; t = 0...

7 years ago | 0

Answered
Local max of a single-column array
Check the logical vector that the islocalmax function returns. I doubt if is entirely zeros, so use the find function to retur...

7 years ago | 0

Answered
How do I draw a squircle?
The easiest way to approach this is to use the contour function to return the result of creating the ‘squircle’ function as an i...

7 years ago | 2

Answered
Changing values of martix in particular column
Try this: M = randi(9, 366, 35); % Create Matrix Original = M(1:10,35); ...

7 years ago | 1

| accepted

Answered
How I can plot the magnitude and phase response of the transfer function
Try this: z = tf('z',-1); H = tf((0.0534*(1+z^-1)*(1-10166*z^-1 + z^-2))/((1-0.683*z^-1)*(1-1.4461*z^-1+0.7957*z^-2))) H.Var...

7 years ago | 1

| accepted

Answered
plotting pre-emphasis
I looked at your filter, and note that it is not actually doing any filtering. The output is essentially the same as the input,...

7 years ago | 0

Answered
How can I make the cycle range symmetric around zero in rainflow ?
After all that (and deleting my first Answer because it was not solving the problem), the solution appears to have turned out to...

7 years ago | 1

| accepted

Answered
ERROR'Not enough input arguments.'
Apparently, you are calling ‘gx’ without an input argument, perhaps by using the green Run arrow in the editor. Functions that ...

7 years ago | 0

Answered
plotting a simple Graph
One problem is that ‘My’ is missing. Beyond that, the linspace arguments resulted in an empty vector for ‘Mx’. It might be...

7 years ago | 1

| accepted

Answered
How to calculate passband and stopband coefficients for signal filtering?
Specifying both passband and stopband frequencies (and without other arguments to the ellip function) means that you are designi...

7 years ago | 1

| accepted

Answered
Getting this error "In an assignment A(:) = B, the number of elements in A and B must be the same."
The problem is that a 5-element character array is not going to fit in a scalar element of ‘new’. A cell array is the easiest...

7 years ago | 0

| accepted

Answered
Curve Fitting with Cosine Phase Shift
The techniques in: Curve fitting to a sinusoidal function should do exactly what you want.

7 years ago | 0

Answered
Why does my matlab say "islocalmax not found" when I try to use it?
The islocalmax function first appeared in R2017b. If you have the Signal Processing Toolbox, use the findpeaks function.

7 years ago | 0

Answered
Fsolve function does not solve a nonlinear system with complex conjugation.
If you are absolutely certain that your function has identifiable roots, choose different initial parameter estimates. (Nonline...

7 years ago | 0

Answered
Function aproximation with exp functions
Try this: t = linspace(-40, 40, 35); s1 = sinc(t/10); s2 = exp(-t.^2/20); objfcn = @(b,t) b(1).*exp(-b(2)*t.^2) + b(3).*s...

7 years ago | 0

Answered
strings become numbers and get in to the matrix
Use logical indexing: v = [ -1 , 0 , 1]; pos = v > 0 neg = v < 0 zro = v == 0 and then do the replacements. See the doc...

7 years ago | 1

Answered
average value of a half wave rectified sine curve
This is straightforward: syms f t t0 t1 halfwave(f,t0,t1) = int(sin(2*pi*f*t), t, t0, t1/2)/(t1 - t0) numericvpa = vpa(half...

7 years ago | 0

| accepted

Answered
I have X Y Z data. How do I create a linear curve in 3 dimensional surface?
Try this: x = [3 123 32 42 22 41]; y = [17 56 67 7 83 93]; z = [3 4.88 9.3 45 31 92]; figure(1) st...

7 years ago | 1

Answered
product of a series
Numerically: m = rand(1, 100); m = rand(1, 100); % Row Vector rm = reshape(m, 2, []); p = pro...

7 years ago | 0

| accepted

Answered
a system of ODEs and curve fitting
See for example: Monod kinetics and curve fitting Parameter Estimation for a System of Differential Equations Optimizing p...

7 years ago | 0

Answered
How to use crossover and mutation ?
There are many possibilities. Likely the simplest: p1 = [ 9 3 6 0 0] % Parent p2 = [1 0 2 5 ...

7 years ago | 0

| accepted

Answered
Plot random points only in certain angles?
I have no idea what angles you want to restrict. Assuming ‘phi’, add these assignments: sel_phi = (phi > 0.1) & (phi < 0.5)...

7 years ago | 0

Answered
Overlaying time series data
You are creating an ensemble. This is frequently done in order to take the mean (ensemble average) of data at particular time p...

7 years ago | 0

Answered
Solving 3 Simultaneous Exponential Equations
Try this: x = [291.15; 293.15; 299.15]; y = [159.2543; 117.2699; 63.8384]; % % % MAPPING: a = b(1), b = b(2), c = b(3) o...

7 years ago | 1

| accepted

Answered
Audioread cannot find WAV file
It is likely most efficient to use the fullfile function to identify the file. Settting the userpath may not be doing what ...

7 years ago | 0

| accepted

Answered
MATLAB Dialog Boxes Help
One approach: lstprmt = {'Choose a variable'}; lstlist = {'x','y','z'}; choice1 = listdlg('PromptString',lstprmt, 'ListStrin...

7 years ago | 0

Answered
how to have datetime for specific range?
Try this: dt1 = datetime([1982 01 01]); dt2 = datetime([2015 12 31]); dt_vec = dt1 : calmonths(1) : dt2; FirstFive = dt_vec...

7 years ago | 1

| accepted

Answered
Error using ezplot on differential equation
Provide the correct numerical values for ‘C’, ‘L’, and ‘Rs’ if you want to plot it: syms C L Rs ya(t) yb y xb t C = sym(3); ...

7 years ago | 0

Answered
Time stamp for discrete Fourier transform
Try this: a=[ 27 26 24 29 35 38 37 35 31 28 27 31 36 39 39 35 35 32 28 26 30 37 40 39 36 33 ] a1=mean(a)%mean of matrix A a2...

7 years ago | 0

| accepted

Load more