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

Answered
Findpeaks the reason why my index is floating
The findpeaks function is interpreting the ‘20’ argument as a sampling frequency, and so is returning the position of the peak a...

3 years ago | 2

| accepted

Answered
I have set of data that I need to fit to a function and I don't seem to get the fitting to work
That function is linear in the parameters (the partial derivatives of the function with respect to each parameter is not a func...

3 years ago | 0

Answered
how to get txt data from fig / plot, if there are multiple curves?
I do not understand what you want to do. Getting the information on the line objects is straightforward — I = openfig(websave...

3 years ago | 0

| accepted

Answered
How to design filter order for high-pass butterworth filter
To determine the optimal order, use the buttord function. Wp= fc/(fs/2); %Threshold Frequency Ws = 0.95*Wp; Rp = 1; Rs = 6...

3 years ago | 0

| accepted

Answered
gradient with irregular grid
The gradient function assumes a fixed step size for the second argument. The way I calculate the numerical derivative using a...

3 years ago | 0

| accepted

Answered
I am trying to Import .csv or excel file into Matlab but its not showing dates after 12th of every month, instead showing NaT. Please Help.
I have never used datastore arrays, however looking at the documentation, it is likely best to select DatetimeType as 'text' and...

3 years ago | 1

| accepted

Answered
how do I write an equation from matlab to latex?
If you have the Symbolic Math Toolbox, use the latex function.

3 years ago | 1

Answered
loop error with "unique" and "interp1"
To avoid all the problems about having unique values in one of the vectors, select a narrow range for the interpolation. That (...

3 years ago | 0

| accepted

Load more