Answered
How to quickly group numerical data without giving bin sizes
I am not certain that there is a robust approach to this sorts of problem. For multivariable problems (each point is a vector d...

2 years ago | 0

| accepted

Answered
Finding similar rows with different I and M columns and create an average of them
Experiment with the unstack function to see if it will do what you want. (The necessary information is missing, so I cannot run...

2 years ago | 0

| accepted

Answered
How to plot LTspice graph in Matlab in this case?
One approach — T1 = readtable('final_all1.txt', 'VariableNamingRule','preserve') T1.MagdB = str2double(extractBetween(T1{:,...

2 years ago | 0

| accepted

Answered
How to obtain the values of R, L and C of a series RLC model of experimentally obtained frequency domain response data in MATLAB?
This is ‘circuit synthesis’ and it is (unfortunately) not trivial. A series RLC model: >--- R - L - C ---> Vin ...

2 years ago | 0

| accepted

Answered
Genetic Algorithm (ga) terminating after a few generations
That is certainly consistent if it converges quickly, and especially if it produces a reasonable result. If your 'InitialPopul...

2 years ago | 0

| accepted

Answered
Help with jumping one position using circshift function in a for loop
The circshift function does not duplicate any values, so I don’t understand how you expect to get the ‘Tn’ matrix at the end. ...

2 years ago | 0

| accepted

Answered
I'm trying to make an image with data from a .txt file
Use readmatrix to read the file. To display the image, then do something like this — % writematrix(rand(80,10),'YourFile.tx...

2 years ago | 1

Answered
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...

2 years ago | 0

| accepted

Answered
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 = ...

2 years ago | 1

Answered
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...

2 years ago | 0

Answered
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...

2 years ago | 0

Answered
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(...

2 years ago | 0

Answered
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...

2 years ago | 0

| accepted

Answered
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 ...

2 years ago | 1

| accepted

Answered
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 ...

2 years ago | 0

Answered
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 ...

2 years ago | 0

| accepted

Answered
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...

2 years ago | 0

Answered
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...

2 years ago | 0

Answered
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...

2 years ago | 0

Answered
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...

2 years ago | 0

Answered
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...

2 years ago | 0

Answered
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...

2 years ago | 0

Answered
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...

2 years ago | 0

| accepted

Answered
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...

2 years ago | 0

| accepted

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

2 years ago | 1

| accepted

Answered
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...

2 years ago | 1

| accepted

Answered
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...

2 years ago | 1

| accepted

Answered
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 = ...

2 years ago | 0

| accepted

Answered
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; %...

2 years ago | 1

| accepted

Answered
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;...

2 years ago | 0

| accepted

Load more