Answered
how to linear interpolate using a for loop
x = linspace(-50, 50, 250); y = x.^2 -2; zx = find(diff(sign(y))) for k = 1:numel(zx) idxrng = max(1,zx(k))-2 : mi...

5 years ago | 0

| accepted

Answered
Index in position 1 is invalid. Array indices must be positive integers or logical values.
To reference ‘Z’ as a matrix, ‘lat’ and ‘lon’ must be integers greater than 0, or logical values. The griddata function may b...

5 years ago | 0

Answered
Converting frequency domain to Time Domain using IFFT.
I made some assumptions and managed to invert the frequency-domain signal — T1 = readtable('https://www.mathworks.com/matlab...

5 years ago | 1

Answered
How to add a line to a freqz plot?
Since freqz plots are ordinary subplots, just address them as such — Fp = 1000; %Bandpass Freq Fs = 2000; %BandStop Freq ...

5 years ago | 1

| accepted

Answered
how can i find the x Value
One option is linspace — x = linspace(-25, 25, 250); part1 = @(x) (x >= 5).*(10*sqrt(x) + 25); part2 = @(x) (x >= 0 & x <...

5 years ago | 0

Answered
Using a for loop to split a matrix by rows
No loops necessary — X = [1 2 3 11 5; 77 1 2 11 3; 1 2 3 4 5; 1 2 3 4 5; 1 11 3 4 5; 1 2 3 4 5] X11 = X(any(X==11,2),:) Xnot...

5 years ago | 0

Answered
How to plot nullclines with differential equations
Work-around — x = linspace(0, 30, size(nullX1,1)); % Use 'linspace' To Create Correct Length 'x' x1min = ...

5 years ago | 0

| accepted

Answered
Simplify the below equation
There are apparently unmatched parentheses. Correct that problem, then try this again — syms v1 y1 Eqn = 2.1894533792906461...

5 years ago | 0

| accepted

Answered
Plotting LTSpice bodeplot in Matlab
This is not the most elegant or efficient way to read and plot this, however it has the advantage of working, so I’m using it — ...

5 years ago | 0

| accepted

Answered
Average the every 40 rows from csv file until finish and save the data in new csv files
I have no idea what you want to do. If you want to take the mean of the 1 second blocks (and you have the Signal Ptocessing T...

5 years ago | 0

| accepted

Answered
How to solve simultaneous differential equations?
It is nonlinear, so it does not have a symbolic solution. Integrate it numerically instead — % Parameters mumax=0.2; Ks...

5 years ago | 0

| accepted

Answered
How to plot the difference between two plots (using shade)
LD1 = load('OBS[1].mat'); OBS = rmmissing(LD1.OBS); LD2 = load('Modeled[1].mat'); Modeled = rmmissing(LD2.Modeled); x ...

5 years ago | 1

| accepted

Answered
Find middle point between extrema and zero crosses
There is no specific function, however the code is relatively straightforward. The result depends on what your data actually ar...

5 years ago | 1

Answered
How to plot inverse laplace function
Since you’re obviously using the Symbolic Math Toolbox, use the fplot function. .

5 years ago | 0

| accepted

Answered
I'd like to plot thee variables from a state space which represents a DC motor.
I am not certain what you actually want to do. One option would be to use the lsim function and a suitable input and appropai...

5 years ago | 0

Answered
plotting number bigger than double realmax
One option would be to plot the base 10 logarithms instead. .

5 years ago | 0

Answered
how can i solve this system on matlab?
A different approach — syms L v x1 x2 x3 y1 y2 y3 sys = [(v+L ==1) (0.25==x1*L + y1*v) (0.45 == x2*L +y2*v...

5 years ago | 1

| accepted

Answered
How do I plot two distributions on top of each other?
To plot an additional distribution on the same axes, use the hold function. For the distribution itself, use the pdf function w...

5 years ago | 0

Answered
How do I calculate a logarithm of a variable base?
The general approach is: So: a = 64 log(a)/log(2) 2^(log(a)/log(2)) See the Wikipedia article on List of lo...

5 years ago | 0

Answered
how do i get the average line graph
I do not have your data, however since they all have the same number of elements as ‘time’ and so can be assumed to be equal len...

5 years ago | 0

Answered
stft plot doesn't match FFT results
If the frequencies are the same in both plots, the only difference is that the STFT plot spans -125 Hz to +125 Hz. The peaks ar...

5 years ago | 0

| accepted

Answered
system unstable although its poles are negative values
You nare not giving the isstable function the correct input. Try this instead — rs=0.84; Vin=40; Vfd=0; rL=.695; C=46.27e-6...

5 years ago | 0

Answered
How to fit multiple peaks/dips
‘Thank you for your response. I would like to smooth the curve so that I get only one peak instead of mutiple smaller peaks. As ...

5 years ago | 0

Answered
Plotting a stem plot of a Fourier series
Supply the correct values for ‘f0’, ‘w’ and ‘t’, and it works — % Plot amplitude vs frequencey f0 = 1; w = 2*pi*f0; n = ...

5 years ago | 0

| accepted

Answered
plotting a grid with red gridlines and where cells have different colors
One approach — N = 5; figure plot([1;1]*(1:N), (ones(N,1)*[0 N]).', '-r') hold on plot((ones(N,1)*[0 N]).', [1;1]*(1:N),...

5 years ago | 1

| accepted

Answered
How can I use solution of an equation as y-limit in an integral2 calculation?
Try this instead — syms x y f(x,y) = (x.^2+y.^2); g = x+y==10; ymax=solve(g,y) integr=int(int(f,x,0,10),y,0,ymax) Just ca...

5 years ago | 0

Answered
How do I run an array through a loop and store the results?
Subscript ‘x’ in each call to it to use each element as a scalar, then calculate the sum at the end — k=1; x=linspace(0,(pi/2...

5 years ago | 0

| accepted

Answered
Polar plot using excel data
The polar and polarplot functions require the angles to be in radians. So using degrees requires the deg2rad function — ang...

5 years ago | 0

| accepted

Answered
find minimal difference for vector (Optimalisation algorithm)
In the Optimization Toolbox, one option is the lsqcurvefit function. To use any of the others (or any of the Global Optimizat...

5 years ago | 0

| accepted

Answered
Is there a two-dimensional sinc interpolation software?
One-dimensional sinc interplation is described in Ideal Bandlimited Interpolation. It may be possible to adapt it to a 2D prob...

5 years ago | 0

| accepted

Load more