Answered
Interpolation using Excel Data
One approach — % C1 = readcell('FluxData.xlsx') T1 = readtable('FluxData.xlsx') xvar = T1{1,3:end}; yvar = T1{2:end,2}; ...

3 years ago | 0

| accepted

Answered
Read excel file with Matlab
One option is to use the datetime 'ConvertFrom' name-value pair. For the ‘value’ argument, both 'excel' and 'posixtime' work, ...

3 years ago | 0

| accepted

Answered
I hava wav file and need to plot spectrogram in matlab
The argument to spectrogram must be a vector. I suspect the error is that ‘y’ is a (Nx2) matrix, and that is throwing the error...

3 years ago | 0

Answered
Nonlinear Regression using a gaussian in a lattice
One approach (using smaller matrices for efficiency and to demonstrate and test the code) — syms a sigma dr = sym('dr',[3 3]...

3 years ago | 0

| accepted

Answered
Why is NaN inserted in wrong position?
It should not do anything, because 5 is in row 2, not row 1. That aside, you need to index into ‘b’ correctly to get the desi...

3 years ago | 1

| accepted

Answered
passing filenames to a dos command
See if the system function will do what you want. Also, see Run External Commands, Scripts, and Programs for a more extensive...

3 years ago | 0

Answered
how can I plot the contours inside not outside?
What result do you want? Try this — figure F = openfig('untitled.fig'); Lines = findobj(F, 'Type','line'); for k = 1:nume...

3 years ago | 0

Answered
how to include symbol on plot line into the legend?
The code plots two lines, however has only one legend entry, so the second series (with the '<' marker) does not show up in the ...

3 years ago | 0

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

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

3 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{:,...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

3 years ago | 0

Load more