Answered
Is it possible to create a plot from a table?
Creating a plot from a table is straightforward, although the references are different — T1 = array2table(randi(99, 5,3), 'Var...

5 years ago | 0

| accepted

Answered
wrong output of parsing datestr
I do not see that there is a problem, other than not specifying that the input times are 12-hour, not 24-hour format. datevec...

5 years ago | 0

| accepted

Answered
Removing rows from array using indices
If ‘Rowidx’ is a logical array, that might not work as desired. If it is a numerical array, then if ‘A’ is any of the arrays ...

5 years ago | 1

| accepted

Answered
How can i get optimization or interpolation value for this 3-data?
I doubt that any interpolation is necessary. Juyst find (and if desired, plot) the minimum and associated values — x = [30 ...

5 years ago | 1

Answered
FFT of sound wave frequency graph
I have no idea what the desired result actually is, even when I run the code and plot it. See if the envelope function will p...

5 years ago | 1

| accepted

Answered
How can I convert categorical variable to continuous variable in MATLAB?
I am not certain which are the categorical variables. The variable names can be referred to as elements of the cell array tha...

5 years ago | 0

| accepted

Answered
Saving vector result from each loop if solution is correct.
Use the exitflag output from fsolve to determine whether a solution was found. .

5 years ago | 0

| accepted

Answered
How to trim audio in Matlab to get the desired audio duration?
Express the desired length in thems of samples (here ‘Fs’ is the smapling frequency in Hz) — desiredLength = 17.5500; ...

5 years ago | 1

| accepted

Answered
How to make the color change in a graph more dramatic
Choosing a different colormap is the only option I am aware of. .

5 years ago | 0

| accepted

Answered
How to compute the magnitude and phase difference of an input and output signal in a single time-domain plot?
See if the alignsignals function will produce the relevant phase information (with respect to the index difference). Without ac...

5 years ago | 0

Answered
i want to treat w as a constant
It ia necessary to include ‘w’ in the syms declaration, then it will be considered a constant unless it is declared as something...

5 years ago | 0

| accepted

Answered
how do i solve simultaneous equation by matrix?
I am not exactly certain how the ‘A’ matrix is created, however the mldivide,\ function and operator is likely the solution to f...

5 years ago | 0

| accepted

Answered
Solving complex coupled differential equations numerically with initial condition
Start with the Symbolic Math Toolbox ... syms A a(t) b(t) delta omega s T eqn1 = diff(a) == 1i*T/2 * (A*cos(omega*T*s)*a + de...

5 years ago | 0

Answered
I have a system of ODE with several parameters. I would like to plot the curves as I vary the parameters,
Use a for loop. Example — tauv = [0.1, 0.4, 0.5, 0.8]; odefcn = @(t,x,tau) [-x(1)*tau; exp(-tau*x(2))]; tspan = 0:0.1:5;...

5 years ago | 0

Answered
How to reduce angle values in a range between 0 and 360 deg?
I am not certain what the desired result is. Something like this came up once before, and since wrap2pi and wrap2360 are avai...

5 years ago | 1

| accepted

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

Load more