Risposto
Find mean of steps in broken signal
One approach — LD = load('y.mat'); y = LD.y; x = 0:numel(y)-1; Lv = islocalmax(y>25, 'FlatSelection','all'); start = s...

circa 3 anni fa | 0

| accettato

Risposto
how plot function sine wave in two variable in MATLAB like y(x,t)=a* sin(wt-kx)
Provide the appropriate constants, then perhaps this — % y(x,t)=a* sin(ωt-kx) % at ω=2*π* λ* c*t ,k=2*π/ λ lambda = ...

circa 3 anni fa | 1

Risposto
how to correct the trendline of a 3d surface plot?
One approach is to use the scatteredInterpolant function with the line coordinates as inpout — [X,Y,Z] = peaks(50); [xmin,x...

circa 3 anni fa | 0

Risposto
Calculation of y axis values or cdf values from given x axis values using another plot of best fit cdf
It would help to have your code and data. Assuming it is similar to this approach, this may do what you want — [f,x] = ecdf...

circa 3 anni fa | 0

Risposto
calculate integration of function
This term, near the beginning of what I call ‘EXPR’ diff(Phi,y,2)+diff(Phi,z,2),t,1)+ ... needs an extra diff call: diff(...

circa 3 anni fa | 0

Risposto
How to represent bar plots efficiently?
One option is to use a logarithmic scale on the y-axis, and then tweak the ylim limits — % Example data (replace with your da...

circa 3 anni fa | 0

| accettato

Risposto
Efficient alternative to find()
The interp1 function with the 'previous' interpolation method may be appropriate here — x0= [1 ,1.1, 1.3, 1.5 ,1.6, 1.7]; y0 ...

circa 3 anni fa | 1

| accettato

Risposto
how to remove baseline wander from ECG?
I generally prefer to use the highpass or bandpass functions for these problems, although you are certainly free to design your ...

circa 3 anni fa | 0

Risposto
Value for Function with 2nd order Central difference scheme
See First and Second Order Central Difference and add enclosing parentheses to the numerator of your implementation of the cosh ...

circa 3 anni fa | 0

| accettato

Risposto
why is this code not running?
What does ‘not running’ mean? What is not working correctly? When I supply values for ‘TimeValue’ and ‘Pdispatch’ it runs wi...

circa 3 anni fa | 0

Risposto
Help using grid in nexttile and tiledlayout
If you want the tick labels just above the x-axis, that is certainly possible. Try this — data = readmatrix('GeoUNAM0404201...

circa 3 anni fa | 0

Risposto
Maximum recursion limit of 5000 reached. PSO algorithm
Your function is: function y = obj_func(x) and the line throwing the error is: p_best_scores = arrayfun(@(i) obj_func(posit...

circa 3 anni fa | 0

Risposto
Solve non linear equation with vector
It looks like you want to do a nonlinear regression. Perhaps this — dados = array2table(sortrows([10*randn(12,1)+35,rand(12...

circa 3 anni fa | 0

Risposto
Plot the unit step response of an RLC circuit, (based on the transfer function) and sketch the response.
Use the tf function, specifically: s = tf('s'); and go from there. First assign the component values, then you can type in t...

circa 3 anni fa | 0

Risposto
Is it possible to restore all the variables from the previous session?
One approach could be something similar to: How to save data from Genetic Algorithm in case MATLAB crashes? - MATLAB Answers - M...

circa 3 anni fa | 0

Risposto
Error using fmincon (not enough input arguments)
The optimisation functions want a vector argument. Create: Sfcn = @(b) S(b(1),b(2)); to do that, and it works — LD = lo...

circa 3 anni fa | 0

| accettato

Risposto
How to calculate the number of points in each rectangular grid cell
Perhaps the histcounts2 function could make this easier. EDIT — (8 Aug 2023 at 15:49) Added this example — x_hit = 0.5+r...

circa 3 anni fa | 0

| accettato

Risposto
CSV readtable dosen't work
Perhaps something like this — T1 = cell2table(compose('%f',randn(5,7))) VN = T1.Properties.VariableNames; T2 = varfun(@str2d...

circa 3 anni fa | 1

| accettato

Risposto
Effect of Increment of Variable on Output in a Multivariate Equation
Perhaps taking the partial derivative of with respect to (creating a sort of sensitivity function) will do what you want. Yo...

circa 3 anni fa | 1

| accettato

Risposto
How to resample (or interpolate) trajectory from x original values to 100 values?
resample_rate = 100; % xypos_resampled = zeros(resample_rate, trialno*2); % make space for multiple trajectories trialtotest...

circa 3 anni fa | 1

| accettato

Risposto
Parse variable in a table
Several options, depending on what you want — timestamp = '2023-02-24 13:00:00' DT = datetime(timestamp) Date = DT; Time = ...

circa 3 anni fa | 0

| accettato

Risposto
File: untitled.m Line: 1 Column: 5
Eliminate the parentheses — C = 3e8; fc = 60e9; lambda = C/fc; N = 2; % number of antenna in Tx M = 2; %...

circa 3 anni fa | 1

| accettato

Risposto
Second Z-axis's
Perhaps this — x = linspace(0, 40, 20).'; zv = linspace(2, 4.5, 4); z = repmat(zv,1,3).*exp(-0.1*x) + rand(numel(x),12)/2.5;...

circa 3 anni fa | 0

| accettato

Risposto
How to export a set of tables to Excel
One option using writetable is to use the 'Sheet' name-value pair (the first entry in the documentation section on Spreadsheet F...

circa 3 anni fa | 0

Risposto
'Polyfit' vs 'Detrend' function
It can be linear although polynomial trends are permitted. To visually understand how it works, see the documentation section o...

circa 3 anni fa | 1

| accettato

Risposto
How to know which decomposition algorithm was applied (trenddecomp ())
As I read the trenddecomp documentation, ‘SSA’ appears to be the default. It would be necessary to specifically choose ‘STL’ wi...

circa 3 anni fa | 1

Risposto
concatenation of solutions of ODE
I would create one ‘tspan1’ vector with a specific number of elemensts, and the same for ‘tspan2’ although they are only require...

circa 3 anni fa | 0

Risposto
How to filter columns and count data
It would help to have the data. I would be tempted to do something like this: Mishaps = readtable('YourData.xlsx') TTCv = Mi...

circa 3 anni fa | 0

Risposto
select a portion of the matrix
One approach — LD = load('matrix_C.mat'); C = LD.C idx = find(sum(C(:,[2 3 4])==0,2)==3, 1); Result = C(1:idx,:) .

circa 3 anni fa | 0

| accettato

Risposto
passive RC highpass magnitude FRF to MATLAB FIR coefficients
I generally don’t design filters with such specificity, and so usually use relatively straightforward command-line functions. T...

circa 3 anni fa | 0

| accettato

Carica altro