Answered
Automate the length of samples in the envelope function to get the optimal peak envelope from various signals
Consider first using either findpeaks or islocalmax with find, and then calculate the appropriate distances (using min, max, mea...

3 years ago | 1

| accepted

Answered
Fitting real data curve to a homogeneous diff
I am not certain from your description what you want to do. However if you have the Signal Processing Toolbox, the resample fun...

3 years ago | 1

| accepted

Answered
Trouble using Bode(sys)
You could have a path problem. Run these: restoredefaultpath rehash toolboxcache from a script or your Command Window to...

3 years ago | 1

Answered
solving 1D drift diffusion model for a semiconductor using FDTD. Can anyone rectify this error.
In the ‘Jp’ and ‘Jn’ calculations, the relevant ‘n’ vectors are (98x1) while ‘E’ is(99x1). That appears to be the problem. I...

3 years ago | 0

| accepted

Answered
Why my code find a second intersection of curve with line and not the first?
See if the lines oif copde I added do what you want — %There are input constants cP=0.05; cN=0.05; cMg=0.005; logb0=2.88; ...

3 years ago | 0

| accepted

Answered
read and convert binary file
It would help to have the file. That aside, the textscan function is likely the easiest way to read it — str = 'AA 08 00 00...

3 years ago | 0

| accepted

Answered
I want to color for $\eta<1.054288$ by blue and red for, $\eta>1.054288$ of a curve from data
This is a bit more involved than it might otherwise seem, because simply using logical indexing to define the red line creates a...

3 years ago | 0

| accepted

Answered
Find the row position corresponding to a value
I assume that ‘gyro_x’ and ‘gyro_y’ contain floating-point numbers, so that explains the error. Indexing into ‘gyro_x’ with ‘g...

3 years ago | 0

Answered
Peaks of a function
This is relatively straightforward — F1 = openfig('Plot.fig', 'visible'); Lines = findobj(F1, 'Type','Line'); t = Lines.XD...

3 years ago | 0

Answered
In 'tiledlayout' command, I want no spacing in x-direction only how to get that?
You can do it with subplot axes, however not with tiledlayout axes. To illustrate — figure tiledlayout(2,2) htl1 = nextti...

3 years ago | 0

| accepted

Answered
How to 3d patch between 2 3d shapes (stl attached)
Use the zip function to zip the .stl file. Then (unless it’s greater than the 5 MB liimit), upload the .zip file. That probl...

3 years ago | 0

| accepted

Answered
Calculate mean from for loop and plotting means for separate for loop
There was an out-of-order statement (‘T’), no subscripting of the ‘Avg_power’ vector, and the wrong independent variable argumen...

3 years ago | 0

Answered
Compute RMS value over 1-second intervals
Try this — movrms = @(A,k) sqrt(movmean(A.^2,k)); Fs = 1000; T = 10; t = linspace(0, T*Fs, T*Fs+1).'; s = randn(size(t))...

3 years ago | 0

Answered
Identifying errors in datetime input strings
If you already know the date fields for day, month, and year, one approach would be to use the eomday function to determine the ...

3 years ago | 1

| accepted

Answered
Filtfilt returns NaN matrix
The transfer function implementation of the filter is unstable, however I cannot determine the reasson for the instability, alth...

3 years ago | 0

| accepted

Answered
How to determine dates when aircraft moving northwards or southwards?
I am not certain that I understand what you want. This approach uses day differences to segment the data into individual ‘Fli...

3 years ago | 0

| accepted

Answered
I get error when I try to plot sigmoid function
Subscript ‘dt’. However the loop is not necessary and does not appear to plot the desired function — M1(1)=0; t(1)=0; h=0.0...

3 years ago | 0

| accepted

Answered
Bode diagram : Warning: Error occurred while evaluating listener callback.
Your code runs without error in R2023a. Perhaps an upgrade is in order — w_0 = 100; D = 10; K = 26.5; s = tf('s'); G = w...

3 years ago | 0

| accepted

Answered
hello, kindly help, I am getting the following error why?: Error using bvp4c Unable to solve the collocation equations -- a singular Jacobian encountered. Error (line 7)
The initial conditions are both 0. Setting them to something else (here eps) solves the immediate problem, and using element-wi...

3 years ago | 0

Answered
trying to solve two non-linear simultaneous equations but I had an error figuring out my two unknowns (X(1) &x(2)) , can anyone pls help?
I cannot fun images of code, only code in text format. I can’t even see all of ‘F’. The problem is the choice of initial con...

3 years ago | 0

Answered
Read CSV into table but not all of the columns
Without at least an example of your .csv file it is difficult to determine that. One option (for both readtable and readmatrix)...

3 years ago | 1

Answered
from cell to datetime
Use 'eeee' for the full name of the day — a={'Monday, 03-Jul-2017 15:00:00'}; datetime(a,'InputFormat','eeee, dd-MMM-yyyy HH:...

3 years ago | 1

| accepted

Answered
How to place tick-labels on the axis, essentially replacing the ticks with the labels?
Perhaps something like this — x = 5:5:25; y = randn(size(x)); figure plot(x, y) xt = xticks; xtl = xticklabels; text(x...

3 years ago | 0

Answered
How do I plot a phase plot for FFT and code time history for down-sampled signal?
Perhaps this — data = [0 0.829668000000000 0.00833300000000000 0.829801000000000 0.0166670000000000 0.82881000000000...

3 years ago | 0

| accepted

Answered
Not enough input arguments
The ode45 call needs to be — [t,y] = ode54(@(t,y)assignment(t,y,u,d), tspan, ic) where ‘u’ and ‘d’ have previously been defin...

3 years ago | 0

Answered
How to output a cell array as a table where the arrays contain vectors of different length?
The cell2table function is an option — V1 = randn(5,1) V2 = randn(10,1) C = {V1 V2} T = cell2table(C) T{:,1}{:} T{:,2...

3 years ago | 0

| accepted

Answered
I have a set of data that I need to separate into unequal intervals in order to calculate the RMS value of these data (The data points are continuous over time)
It is not obvious to me exactly what you want to calculate. This isolates the regions between the spikes (that I refer to as ‘s...

3 years ago | 1

Answered
How to find time step of video signal?
In the VideoReader documentation, see both FrameRate, and CurrentTime for each frame since the time steps may not be constant. ...

3 years ago | 0

| accepted

Answered
How can I plot an equation that includes sigma?
I changed ‘t’ to ‘tv’ and then created ‘t’ in each iteration as ‘tv(k1)’ to produce a vector for ‘total’ that is then plotted at...

3 years ago | 0

| accepted

Answered
write matrix into a new file everytime a value of one column changes
One approach — T1 = array2table([ 0 0.55 0.1 1 0.37 0.1 2 0.03 ...

3 years ago | 0

| accepted

Load more