Answered
Data normalization with threshold
I am not certain what you want to do. Perhaps one of these — data = [10,30,50,75]; threshold_value = [70]; Result = no...

3 years ago | 1

| accepted

Answered
How to save the scatter plot with and without transparency
The gca function (of course) is ‘get current axes’, and it does exactly that. One option is to save an axes reference in each s...

3 years ago | 0

| accepted

Answered
Undefined function 'geomean' for input arguments of type 'double' in Matlab 2020
An alternative is: gm = @(x) prod(x)^(1/numel(x)); x = rand(1,100); y1 = geomean(x) y2 = gm(x) .

3 years ago | 2

Answered
Extracting specific data from time range excel
It would help to have the Excel file. The ‘1 data raeading per hour’ request is open to intpretation. First, convert the t...

3 years ago | 1

| accepted

Answered
Normalize the amplitude of a sinewave of varying amplitude and frequency
‘I need to determine each "cycle" by detecting zero crossings and the peaks and valleys, then determining the peak and vally for...

3 years ago | 0

Answered
How can I remove a pulse from a soundwave?
If the pulse is at a single frequency with known bandwidth, just use a bandstop filter. If there is energy at several frequenci...

3 years ago | 2

Answered
Don't know how to fix error preallocating for speed
It’s likely not an error, simply a suggestion that preallocating for speed would be advisable. (A preallocated loop generally r...

3 years ago | 0

Answered
How to create for loop
You need to convert the numeric vectors into polynomials in before taking the inverse Laplace transform of them. Even then, th...

3 years ago | 0

| accepted

Answered
Detecting peaks and valleys in signal
I do not have your data. See if the 'MinPeakDistance' name-value pair will help to isolate them. Experiment with it to ignor...

3 years ago | 1

| accepted

Answered
How to separate time series data?
It depends how they are formatted. Assuming the times are a datetime array — t = datetime(1,1,1) + seconds(0:0.5:15).'; s ...

3 years ago | 0

Answered
Need to create a table with values from a bode plot
One approach would be to use the freqresp function with, for example: w = [1; 10; 100]; then calculate the magnitude and phase...

3 years ago | 1

| accepted

Answered
Z must be a matrix, not a scalar or vector.
It would be helpful to have the actual data rather than a ‘proxy problem’. The ‘Z’ vector should have the dame number of elemen...

3 years ago | 1

| accepted

Answered
adding cells of two arrays
Perhaps something like this — A = {[10,9,13,21,18] [9,9,11,18,18]}; B = {[11,10,12,20,19] [10,9,13,21,18]}; C = cellfun(@(...

3 years ago | 1

Answered
Reconstruction of a Signal from the Real Part of Its Discrete Fourier Transform for matlab
No. You will need the complex part (or equivalently, the phase information) to accurately reconstruct the signal. Otherwise,...

3 years ago | 0

Answered
extracting unique numbers from a cell array
One approach — G{1} = [1]; G{2} = [1]; G{3} = [2,3,4]; G{4} = [4,5]; Len2 = cellfun(@(x)numel(x)>=2, G) Gu = unique([G{...

3 years ago | 1

| accepted

Answered
fmincon and choosing different initial values
The Global Optimization Toolbox has a number of functions that can search the parameter space for different initial parameter es...

3 years ago | 0

Answered
In this code, I want to find out slope at every value of x?
Try something like this — x=[10.33 10.331 10.332 10.333 10.334 10.335 10.336 10.337 10.338 10.339 10.34 10.341 10.342 10.343 1...

3 years ago | 0

Answered
Smoothing a noisy signal
Experiment with this approach — LD = load(websave('pressure','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1...

3 years ago | 0

Answered
How can I access Ydata from interaction plots?
Using an example from the interactionplot documentation — rng default; % For reproducibility y = randn(1000,1); % Rand...

3 years ago | 0

Answered
Changing a parameter in a trasferire function
I demonstrated this in your earlier post: How to change a parameter in a model. The same approach applies here — s = tf('s'...

3 years ago | 0

| accepted

Answered
how to plot a mean line in a plot
‘I need to mean line to be at the same angle as my fluctuations.’ You apparently want the linear regression of ‘u1’ as a functi...

3 years ago | 1

| accepted

Answered
3D mesh plot
The ‘x’ vector is missing a ‘30’ value (supplied here). I get a different result when I plot those data — x = [0 10 20 30 0...

3 years ago | 0

Answered
How to change a parameter in a model
Try something like this — A = @(h,k) [ -1 0 0; -1 h k; 0 0 -3]; % Create As Anonymous Function B = [ 1; 1; ...

3 years ago | 0

Answered
How to Smooth signal data to find clean peaks
I am not certain what you want. One option is simply to use a lowpass filter, then adjust the ‘CutoffFreq’ variable until you ...

3 years ago | 0

| accepted

Answered
3d plot from knows XYZ
It will be necessary to interpolate them to create a surface. There are seeral ways to interpolate them, my favourite being t...

3 years ago | 1

Answered
Data fitting to a function that has the dependent y variable on both sides of the equation
I would do something like this — x = (1:10).'; y = rand(size(x)); B0 = rand(3,1); [B,fval] = fminunc(@(b)norm(y - b(1).*s...

3 years ago | 0

Answered
Trend lines with moving average
It is unlikely that it is posssible to get any meanigful information from these unless they are first sorted. LD = load(websa...

3 years ago | 0

| accepted

Answered
60 years of daily data; need to group separately by month and year
One approach for the mean values — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1307475/Flow...

3 years ago | 0

| accepted

Answered
How to sort data in a bar plot based on its values on Y-axis?
I assume the x-data are categorical, because otherwise this is straightforward. Perhaps this — x = 1:5; y = rand(1,5); xl...

3 years ago | 1

| accepted

Answered
LogLog Plot is Blank
Use element-wise division: y = (B.*x)/((log(A.*x) - log(log(1 + 1/GamSE)))*dM); ↑ ← HERE and it works! %Paschen...

3 years ago | 0

| accepted

Load more