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

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

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

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

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

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

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

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

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

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

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

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

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

4 years ago | 0

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

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

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

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

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

4 years ago | 0

Answered
Illegal use of reserved keyword "end", Error. Can some help me with it?
MATLAB is case-sensitive. This: Function [trans] = Trans_tensor2crystalori(o) needs to be: function [trans] = Trans_tensor2...

4 years ago | 0

Answered
Error invalid expression input variable
If you’re only running it using the online Run feature here, note that the online Run feature doesn’t support any interactive fu...

4 years ago | 1

| accepted

Answered
how to get in the function values above zero only and the plot stop at zero and above
Use a logical index mask — global A R=8.314; F=96485; Alfa=0.1668; n=2; c1=174512; c2=5485; T=343; T1=353; T2=363; k...

4 years ago | 0

| accepted

Answered
How to plot bode plot in 3D?
Try something like this — Fs = 44100; Ts = 1/Fs; f = logspace(-3, +5, fix(Fs/10)); w = 2*pi*f(:); R = 1e3; % resistor va...

4 years ago | 0

Answered
Error (line 43) Conversion to double from cell is not possible.
I limited this to three iterations because of time constraints (I’m running it offline and have been for a few minutes, so this ...

4 years ago | 1

Answered
How to fit a defined function?
The ‘fun’ function must be presented to lsqcurvefit as a function handle using the ‘@’ operator — x = [1 2 3 4 5]'; % x data ...

4 years ago | 1

| accepted

Answered
Find all global minima und maxima of an Graph
The findpeaks function has a number of name-value pair arguments that you can use to restrict what it returns. (My favourite is...

4 years ago | 0

| accepted

Answered
how filter the noise frequency of an audio file with notch filter
Use the zip function to create a .zip file for the .wav file and the upload that. Beyond that, your numerator and denominator...

4 years ago | 0

| accepted

Answered
How to plot a plot a function that contains itself
One option is to use the isolate function (essentially equivalent to solve) — syms a b y Eqn = y == a * log(b*y) Eqn = isol...

4 years ago | 1

| accepted

Answered
The problem of constants in linear least squares
since it is a constant, becomes a vector of ones — x = [1.02; 0.95; 0.77; 0.67; 0.56; 0.30; 0.16; 0.01]; y = [0.39; 0.32; 0....

4 years ago | 0

| accepted

Answered
how to claculate fft with window function?
The first is correct. Note that ‘s’ needs to be a column vector. Fs = 1000; L = 1E+4; t = linspace(0, L-1, L).'/Fs; ...

4 years ago | 0

| accepted

Answered
How to replicate bode plot
The problem is that you wer not sending the same vectors to your tf call that you were using in the symbolic solution. Note tha...

4 years ago | 0

| accepted

Load more