Answered
How to find a delay between two similar vectors
Use the finddelay function. (The introduction release isn’t stated in the documentation, however I believe it’s been available ...

5 years ago | 0

Answered
Change Backgroundcolour of Plot
Try this for a start — a = linspace(0, 2*pi, 200); r = [1;2;3]*ones(size(a)); [A,R] = pol2cart(a.',r.'); radials = linspa...

5 years ago | 0

Answered
Intersection of yline and x,y categorical data
Since the ‘y’ values are monotonically decreasing, using interp1 is straightforward with the second vector, however there is no ...

5 years ago | 0

| accepted

Answered
Matrix convulsion in the x,y plane with intersections
Again using the same example from the documentation — a = [1 0.4 1]; b = [0.2 0.3 1]; w = logspace(-1,1.3); h = freqs(b,a...

5 years ago | 0

Answered
Storing data from a triple for loop in a matrix
Store the intermediate results in cell arrays, and sort the results out later — for i = 1:3 % The for loops runs 27 times ...

5 years ago | 0

| accepted

Answered
How to change x-axis to not use scientific notation
I have no idea what the problem is, because the posted code works correctly here and on my computer (R2021b) — x = logspace(...

5 years ago | 2

| accepted

Answered
How to remove asymptote lines from my plots?
This is actually fairly straightforward using the ShowPoles property — syms x y = tan(x); figure fplot(tan(x), [-pi...

5 years ago | 3

| accepted

Answered
Loop over ode45 to find minimum of a parameter
There are several examples on fitting differential equations to data, one being Coefficient estimation for a system of coupled O...

5 years ago | 0

Answered
What is the difference between v(i):v(j) and v(i:j)?
Without knowing what the elements of ‘v’ are, it is sifficult to say exactlly. The ‘v(i):v(j)’ code creates a vector from ‘v(...

5 years ago | 1

| accepted

Answered
I want a draw a line parallel to x axis in the existing graph while plotting itself
Try something like this — x = 1:20; y = randn(size(x)); xi = linspace(min(x), max(x), numel(x)*10); yi = interp1(x, y, ...

5 years ago | 0

Answered
How to make the errorbar and the data line have different line width
Use a marker with errorbar and plot the errorbar separately from the original curve— dt = [sin((1:10));cos((1:10))]; figu...

5 years ago | 0

| accepted

Answered
Integral doesn't work
I have no idea what the arguments are, or what ‘doesn’t work’ means. However, since the integrand is apparently an array, see...

5 years ago | 1

| accepted

Answered
How can I delete rows in which a specific value is present?
Try something like this — D = randi(9, 10, 12); D(randi(numel(D),1,3)) = 999.25 D = D(~any(D==999.25,2),:) This searches ...

5 years ago | 1

Answered
Implicit differentiation with multiple variables
One approach — syms f(beta,I,S) beta I S df = diff(f,beta) .

5 years ago | 0

Answered
using MATLAB for space link
It depends whether they contain symbolic variables or if they are functions (and I can’t determine that from the code snippet). ...

5 years ago | 0

Answered
I created two arrays and a matrix and I'm trying to use the 'surf' function to plot but its erroring.
Vectors need some sort of delimiters (spaces, commas, semicolons) to be defined correctly. x=[123456]; ...

5 years ago | 0

Answered
How to plot multiple functions on same figure using fplot?
The problem is that the polyfit call returned NaN for both parameters. I substituted a simple nonlinear power relation and used...

5 years ago | 0

| accepted

Answered
I am getting error
Use element-wise operations everywhere and it works — t=linspace(0,15); x=(3*t.^2-5).*(t.^3).*sind(t./2)-8*t+27; v=6*t-2.5*(...

5 years ago | 1

Answered
can fourier transform separate two signals/voices from audio file
Since there are not only a large number of overlapping frequencies and also no way to distinguishthem in time, it is unlikely th...

5 years ago | 0

Answered
What does @m and m(:) signify here?
Correctly stated ‘@(m)’ is a function handle (see What is a Function Handle? for details) and the ‘m(:)’ forces the argument ‘m’...

5 years ago | 1

Answered
curve fit a custom polynomial
One approach — syms A B C D r z sf = A*r^2 + B*z + C*r + D == 0 sfiso = isolate(sf, z) zfcn = matlabFunction(rhs(sfiso), '...

5 years ago | 0

| accepted

Answered
How to determine phase shift
Subtracting them is likely appropriate, however unwrapping them first will likely produce the correct result. T1 = readtabl...

5 years ago | 0

| accepted

Answered
I want to plot audio files in Vertically
See if the strips function will produce the desired result. .

5 years ago | 0

| accepted

Answered
Errorbar overlapping with the left and right border of a plot
Add an xlim (or axis) call — a = [1,2,3,4;5,6,7,8] figure errorbar(mean(a),std(a)) xlim(xlim+[-1 1]*0.2) ...

5 years ago | 0

| accepted

Answered
Timetable_finding each months average from 2000-2020 for all 11 states
See if the retime function will produce the desired result. .

5 years ago | 0

Answered
Evaluate for specific frequencies using freqs
Using an example from the freqs documentation — a = [1 0.4 1]; b = [0.2 0.3 1]; w = logspace(-1,1.3); h = freqs(b,a,w); ...

5 years ago | 0

Answered
Table calculating of one colomn based another columns value
If the desire is to have a table with the variables being the ‘TurbineID’, see if the unstack function will work. Analysing the...

5 years ago | 0

Answered
Find the max using PSO
This is at least the second time (the first that I°m aware of is how to get maximum value of this code) you’ve asked the same qu...

5 years ago | 0

| accepted

Answered
What do I need to fix in this code to get the maximum value?
This is at least the second time (the first that I°m aware of is how to get maximum value of this code) you’ve asked the same qu...

5 years ago | 0

| accepted

Answered
how to get maximum value of this code
Important parts of the code appear to be missing. However to get the maximum, negate the function — f = @(x) sin(x); x0...

5 years ago | 0

| accepted

Load more