Beantwortet

Hi , all there , i have an excel file that i want to split it by special element value in the file to some files . how can i make it possoble with matlab

To begin a new sub-array whenever a zero appears in any row, this works — M = randi([0 20], 15, 4) ZeroInRow = any(M==0,2); ...

Hi , all there , i have an excel file that i want to split it by special element value in the file to some files . how can i make it possoble with matlab

To begin a new sub-array whenever a zero appears in any row, this works — M = randi([0 20], 15, 4) ZeroInRow = any(M==0,2); ...

16 Tage vor | 0

Beantwortet

How to find troughs of a signal below a threshold

Use the 'MinPeakHeight' name-value pair — t = linspace(0, 2*pi, 500); s = sin(2*pi*t) - sin(2*pi*0.1*t-0.45); Threshold ...

How to find troughs of a signal below a threshold

Use the 'MinPeakHeight' name-value pair — t = linspace(0, 2*pi, 500); s = sin(2*pi*t) - sin(2*pi*0.1*t-0.45); Threshold ...

16 Tage vor | 0

Beantwortet

How do I fill colour on both sides of the sin wave in this graph?

Using the patch function — % Define the time axis (x-axis) t = linspace(0, 12, 1000); % Define the parameters of the sinusoi...

How do I fill colour on both sides of the sin wave in this graph?

Using the patch function — % Define the time axis (x-axis) t = linspace(0, 12, 1000); % Define the parameters of the sinusoi...

16 Tage vor | 0

Beantwortet

code is right but can not the a plot

You need to redefine ‘t’ so that it matches the row size of ‘u’: t = linspace(0, 2.5, size(u,1)); Try this — % clear % cl...

code is right but can not the a plot

You need to redefine ‘t’ so that it matches the row size of ‘u’: t = linspace(0, 2.5, size(u,1)); Try this — % clear % cl...

17 Tage vor | 0

| akzeptiert

Beantwortet

Plot several time series data stacked in one graph

Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1314900/Data.xlsx') VN = T1.Propert...

Plot several time series data stacked in one graph

Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1314900/Data.xlsx') VN = T1.Propert...

17 Tage vor | 1

| akzeptiert

Beantwortet

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

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

18 Tage vor | 1

| akzeptiert

Beantwortet

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

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

18 Tage vor | 0

| akzeptiert

Beantwortet

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

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

18 Tage vor | 2

Beantwortet

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

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

18 Tage vor | 1

| akzeptiert

Beantwortet

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

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

19 Tage vor | 0

Beantwortet

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

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

19 Tage vor | 2

Beantwortet

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

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

20 Tage vor | 0

Beantwortet

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

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

20 Tage vor | 0

| akzeptiert

Beantwortet

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

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

20 Tage vor | 0

Beantwortet

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

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

20 Tage vor | 0

Beantwortet

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

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

21 Tage vor | 1

| akzeptiert

Beantwortet

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

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

21 Tage vor | 1

| akzeptiert

Beantwortet

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

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

21 Tage vor | 1

Beantwortet

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

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

21 Tage vor | 0

Beantwortet

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

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

21 Tage vor | 1

| akzeptiert

Beantwortet

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

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

21 Tage vor | 0

Beantwortet

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

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

21 Tage vor | 0

Beantwortet

Smoothing a noisy signal

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

Smoothing a noisy signal

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

22 Tage vor | 0

Beantwortet

How can I access Ydata from interaction plots?

Using an example from the interactionplot documentation — rng default; % For reproducibility y = randn(1000,1); % Rand...

How can I access Ydata from interaction plots?

Using an example from the interactionplot documentation — rng default; % For reproducibility y = randn(1000,1); % Rand...

22 Tage vor | 0

Beantwortet

contour for scatter data

I am not certain what result you want. One option — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploade...

contour for scatter data

I am not certain what result you want. One option — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploade...

23 Tage vor | 0

Beantwortet

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

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

23 Tage vor | 0

| akzeptiert

Beantwortet

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

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

23 Tage vor | 1

| akzeptiert

Beantwortet

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

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

23 Tage vor | 0

Beantwortet

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

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

23 Tage vor | 0

Beantwortet

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

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

24 Tage vor | 0

| akzeptiert