Answered
Solving ODEs for chemical rate equations
Here is prototype code for integrating the solution for a different kinetic parameter estimation problem with four rate equation...

3 years ago | 1

| accepted

Answered
finding the Column name of a matrix
I am not certain what you want to do. The equality comparison operator in MATLAB is the double-equal (==) operator — A = ra...

3 years ago | 0

| accepted

Answered
Error using / matrix dimensions must agree
The ‘y’ expression is not a function of ‘x’. Correcting that (and assuming the independent variable is actually ‘ec’) — ec ...

3 years ago | 1

| accepted

Answered
Why is the derivative of a matrix not of the same order?
Use the gradient function instead of diff.

3 years ago | 1

| accepted

Answered
SURF Surface-Plot
Concatenate the column vectors horizontally (to create matrices) instead of vertically (to create column vectors) and it sort of...

3 years ago | 0

| accepted

Answered
3 d plot for the symbolic calculation
The problem was with the fsurf call (and ‘r’ was not defined). This changed version: fsurf(series1,[-50 50 0 50]) works —...

3 years ago | 0

Answered
How to sort an excel sheet by one column matlab
Use readtable to import it then sortrows to sort it. If you want to save the sorted version, use writetable to write it as an ....

3 years ago | 0

Answered
why full area not filled? area under the curve
For the fill (and patch) functions it is necessary to create a closed area. One way to do that is to flip the second vector in ...

3 years ago | 1

| accepted

Answered
How to find maximum among several local peaks?
It would help to have the data. If that is the maximum peak in value, it is also the maximum of the vector plotted in the im...

3 years ago | 0

| accepted

Answered
Does findpeaks only provide one output?
First, what version /release of MATLAB are you using? If the version in your documentation (not the online documentation unle...

3 years ago | 2

| accepted

Answered
Change Sample Rate Audio
I would do something like this, using the Signal Processing Toolbox resample funciton — filename = "test.wav"; [y,fs] = audio...

3 years ago | 0

| accepted

Answered
How to take the average every 4 data points?
An easier way is to just reshape the vector to a matrix, and then take the mean of the columns — v = (1:9536).'; vm = reshape...

3 years ago | 3

| accepted

Answered
Can I return 'nan' value for bad data?
One option would be to create the left side as a cell array (so the dimensions do not have to match) and then deal with any inco...

3 years ago | 0

Answered
Finding average heart rate of EKG data
I woiuld use findpeaks with an appropriate value for 'MinPeakProminence' to select only the R-deflections. Example — [y,Fs]...

3 years ago | 0

| accepted

Answered
problem with scatteredInterpolant: are there any limits?
It would help to have the file. It appears to me that the data might be gridded. To determine that, the easiest way would be...

3 years ago | 1

| accepted

Answered
How to display the current result when the program is forced to abort?
One option would be to save the intermediate results to a .mat file. It might be necessary to re-write it in each iteration of ...

3 years ago | 0

Answered
Not enough input arguments using ode45
You already did everything necessary. Just change the ode45 call to: [t, x]=ode45(fun,timerange,IC); and it works — close...

3 years ago | 1

| accepted

Answered
finding the distance between two points
I am not exactly certain what you want. Calculating the perimeters of each segment appears to be straightforward — % prompt...

3 years ago | 0

Answered
Area plot matlab colors
With so little information, I can only suggest one approach, that being serial area calls or concatenating the ‘array’ variables...

3 years ago | 0

| accepted

Answered
Calculating number of operations during GA run
A lot depends on the 'InitialPopulationMatrix' and how it is defined, parameter constraints, and other considerations. If app...

3 years ago | 0

| accepted

Answered
Conversion from FFT to IFFT
It is likely not efficient to do filtering by editing the fft result (although it can be done). If you want to do it that way, ...

3 years ago | 0

Answered
Why can't I put unassigned variables in a 2 x 1 matrix?
One option would be to use the Symbolic Math Toolbox — syms x y coefficients = [2 -1; 3 2] constants = [4; 13] variables =...

3 years ago | 1

| accepted

Answered
Need help with a contour plot
It is difficult for me to understand what you want. It is certainly poossible to get only one contour from each matrix and th...

3 years ago | 0

Answered
Plot of fft of data is mirrored, unsure how to fix it
It respects the Nyquist limit. If you use the fftshift function you will see the result as negative frequencies and positive fr...

3 years ago | 0

| accepted

Answered
Need help on a homework problem
Try something like this — result = MyRand result = MyRand(10) result = MyRand(90, 95) function int = MyRand(a,b) n=nargi...

3 years ago | 0

Answered
How can I plot Kendall tau trend by using MATLAB code?
Start with a File Exchange search for kendall.

3 years ago | 0

| accepted

Answered
Increase the accuracy of vector differentiation
The best way to calculate the numerical derivative is with the gradient function. Since differentiation amplifies noise, filt...

3 years ago | 1

Answered
I have 2 sets of noisy data when plotted against each other forms a parallelogram . I want to simplify this to a simple parallelogram with 4 vertices and find the area within.
It is first necessary to define the boundary and then use polyarea — T1 = readtable('https://www.mathworks.com/matlabcentral/a...

3 years ago | 0

| accepted

Answered
Matrix dimensions must agree. Error q=ones(m)-u;
Use: q=ones(size(u))-u; instead to get this result — u= ([1 0.5 0.3 0.2; 2 3 4 5]); [m,n]=size(u); q=ones(size(u))-u; ...

3 years ago | 0

Answered
Inverse FFT for Signal Components
If you just want to filter two frequencies from your signal, either use two bandpass calls (for best results, use the 'ImpulseRe...

3 years ago | 0

Load more