Answered

Decomposing the time series of wind turbulance using Fourier series, and computing the spectra.

Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1125355/data-MOOCTurbulenceDataSerie...

Decomposing the time series of wind turbulance using Fourier series, and computing the spectra.

Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1125355/data-MOOCTurbulenceDataSerie...

13 days ago | 1

Answered

extract a section of a vector and plot

Perhaps something like this — t = linspace(0, 10, 250); s = sin(2*pi*t); figure plot(t,s) grid [pks,locs] = findpeaks...

extract a section of a vector and plot

Perhaps something like this — t = linspace(0, 10, 250); s = sin(2*pi*t); figure plot(t,s) grid [pks,locs] = findpeaks...

13 days ago | 0

Answered

Converting a time field (+000:00:00) in a table to a usable format

Use the second function with the 'secondoofday' argument (or whatever you want from it) — format long G dt = datetime('now'...

Converting a time field (+000:00:00) in a table to a usable format

Use the second function with the 'secondoofday' argument (or whatever you want from it) — format long G dt = datetime('now'...

14 days ago | 0

Answered

Filter signal with 2 different frequencies

Use either the bandpass or bandstop functions, depending on the result you want. For best results, use the 'ImpulseResponse',...

Filter signal with 2 different frequencies

Use either the bandpass or bandstop functions, depending on the result you want. For best results, use the 'ImpulseResponse',...

14 days ago | 0

| accepted

Answered

Add 2 sec. of noise as a reference for a spectrogram infront of a 2 second long sinus function.

Try this — fs = 44200; % Sampling frequency (samples per second) dt = 1/fs; % second...

Add 2 sec. of noise as a reference for a spectrogram infront of a 2 second long sinus function.

Try this — fs = 44200; % Sampling frequency (samples per second) dt = 1/fs; % second...

14 days ago | 0

Answered

How can I have for loop show me each histogram it created rather then play it like a movie?

I am not certain what you are doing or the result you want. I don’t see an end for the for loop, so I assume everything is in t...

How can I have for loop show me each histogram it created rather then play it like a movie?

I am not certain what you are doing or the result you want. I don’t see an end for the for loop, so I assume everything is in t...

14 days ago | 0

| accepted

Answered

How do you get realistic textures when shading graphs?

I am not certain what result you want. One option is to interpolate the ‘mycolors’ matrix — x = @(r, t) r.*cos(t); y = @(r...

How do you get realistic textures when shading graphs?

I am not certain what result you want. One option is to interpolate the ‘mycolors’ matrix — x = @(r, t) r.*cos(t); y = @(r...

14 days ago | 0

Answered

Converting tremor data in to frequency and filter data

The fft plots are straightforward, however only the acceleration signals make sense. The ‘Gyr’ signals exhibit broadband noise....

Converting tremor data in to frequency and filter data

The fft plots are straightforward, however only the acceleration signals make sense. The ‘Gyr’ signals exhibit broadband noise....

14 days ago | 0

Answered

PLOT surface using 3 vectors of same length (NEED HELP!!!)

The code produces vectors, so I would simply reshape them, using the number of unique elements in ‘i’ to determine one of the di...

PLOT surface using 3 vectors of same length (NEED HELP!!!)

The code produces vectors, so I would simply reshape them, using the number of unique elements in ‘i’ to determine one of the di...

15 days ago | 0

Answered

Find rows based on set of values/codes

I am not certain what you want, however the ismember function might be a better option than find for this, especially since ever...

Find rows based on set of values/codes

I am not certain what you want, however the ismember function might be a better option than find for this, especially since ever...

15 days ago | 0

| accepted

Answered

Solve implicit equation for isentropic flow

When in doubt, plot the function — Aratio=4; g=1.4; % fcn = @(M) (1./M).*((2/(g+1)).*(1+(((g-1)/2).*M.^2)).^((g+1)/(2*(g-1))...

Solve implicit equation for isentropic flow

When in doubt, plot the function — Aratio=4; g=1.4; % fcn = @(M) (1./M).*((2/(g+1)).*(1+(((g-1)/2).*M.^2)).^((g+1)/(2*(g-1))...

15 days ago | 0

| accepted

Answered

Remove periodic noise in Raman spectra by FFT

I have no idea what your spectra look like, however removing truly periodic noise would likely be appropriate for a digital filt...

Remove periodic noise in Raman spectra by FFT

I have no idea what your spectra look like, however removing truly periodic noise would likely be appropriate for a digital filt...

15 days ago | 0

Answered

RF filer design Matlab

I don’t have the RF Toolbox (since I don’t need it, although earlier as a U.S. Amateur Extra Class Amateur Radio operator, it wo...

RF filer design Matlab

I don’t have the RF Toolbox (since I don’t need it, although earlier as a U.S. Amateur Extra Class Amateur Radio operator, it wo...

15 days ago | 0

Answered

How to generate a nonlinear equation from MATLAB?

Try something like this — X=[0 1 1.1 1.15]; Y=[0 0.0042 0.0097 0.016]; fcn = @(b,x) b(1) .* exp(b(2).*x); format long [B...

How to generate a nonlinear equation from MATLAB?

Try something like this — X=[0 1 1.1 1.15]; Y=[0 0.0042 0.0097 0.016]; fcn = @(b,x) b(1) .* exp(b(2).*x); format long [B...

16 days ago | 0

| accepted

Answered

help with formatting the title of a set of graphs

Using the sprintf function is one option — i = 1; runType = 'Reducing'; samples{1} = 'AK STEEL'; title(sprintf('Area and \\...

help with formatting the title of a set of graphs

Using the sprintf function is one option — i = 1; runType = 'Reducing'; samples{1} = 'AK STEEL'; title(sprintf('Area and \\...

16 days ago | 0

| accepted

Answered

How to plot colorbar and plot size different?

One option would be to stretch the figure by adjusting the 'Position' property. It is possible to re-position it and stretch (o...

How to plot colorbar and plot size different?

One option would be to stretch the figure by adjusting the 'Position' property. It is possible to re-position it and stretch (o...

16 days ago | 0

| accepted

Answered

delete consecutive commas in txt file

Use readmatrix with additional name-value pair arguments to select the delimiter and combine multiple consecutive delimiters. S...

delete consecutive commas in txt file

Use readmatrix with additional name-value pair arguments to select the delimiter and combine multiple consecutive delimiters. S...

16 days ago | 1

| accepted

Answered

How to plot multiple curves on the same screen for different values of "b" with bvp4c solver?

The problem is that the initial conditions are uniformly zero, so any change in ‘b’ will not be evident since the entire result ...

How to plot multiple curves on the same screen for different values of "b" with bvp4c solver?

The problem is that the initial conditions are uniformly zero, so any change in ‘b’ will not be evident since the entire result ...

16 days ago | 0

| accepted

Answered

How can I compute the Area and the Centroid of the following shape?

The polyshape approach is the easiest way to go on this. However it is possible to calculate this using the trapz function an...

How can I compute the Area and the Centroid of the following shape?

The polyshape approach is the easiest way to go on this. However it is possible to calculate this using the trapz function an...

16 days ago | 1

| accepted

Answered

How to know the x projection in this function if the y is known?

Use interp1 to interpolate — xA = 0; xB = 1; xf = 1; x = linspace(0, xf, xf*1e4 + 1); a = 9.2; % c = 0.5; % cen...

How to know the x projection in this function if the y is known?

Use interp1 to interpolate — xA = 0; xB = 1; xf = 1; x = linspace(0, xf, xf*1e4 + 1); a = 9.2; % c = 0.5; % cen...

16 days ago | 1

| accepted

Answered

Functions only plotting out to x=5

To plot from 0 to 10, change the fplot call to: fplot(y,[0 10]); Then it works without further modification — syms t C1 C2;...

Functions only plotting out to x=5

To plot from 0 to 10, change the fplot call to: fplot(y,[0 10]); Then it works without further modification — syms t C1 C2;...

17 days ago | 0

| accepted

Answered

How should I plot the function (sqrt(1 + x) - 1) / x using the values x = 0.1, 0.01, 0.001, ..., 10^-20?

Using the logspace function to create the independent variable ‘x’ vector makes this easier. Plot it as a function of the in...

How should I plot the function (sqrt(1 + x) - 1) / x using the values x = 0.1, 0.01, 0.001, ..., 10^-20?

Using the logspace function to create the independent variable ‘x’ vector makes this easier. Plot it as a function of the in...

17 days ago | 0

Answered

filtering excel commands in matlab

I have no idea what you want or the reason a 3D matrix is necessary. A different approach using unstack — T1 = readtable('h...

filtering excel commands in matlab

I have no idea what you want or the reason a 3D matrix is necessary. A different approach using unstack — T1 = readtable('h...

18 days ago | 0

Answered

print to screen with fromat

Using only the posted data — C = {1 '10-Sep-2022 09:16:46' 45.000 3.000 1.000 3.850 5.200 11.250 9.300 -0.04...

print to screen with fromat

Using only the posted data — C = {1 '10-Sep-2022 09:16:46' 45.000 3.000 1.000 3.850 5.200 11.250 9.300 -0.04...

18 days ago | 0

| accepted

Answered

Solving system of two (non)-linear eqautions multiple times using a for loop

I am not certain what the problem is, however putting square brackets [] around the variables you want to solve for may do what ...

Solving system of two (non)-linear eqautions multiple times using a for loop

I am not certain what the problem is, however putting square brackets [] around the variables you want to solve for may do what ...

18 days ago | 0

| accepted

Answered

Movavg function doesn't compute values for the entire timeseries

Use the fillmissing function — LD = load(websave('august_filtered_data','https://www.mathworks.com/matlabcentral/answers/uploa...

Movavg function doesn't compute values for the entire timeseries

Use the fillmissing function — LD = load(websave('august_filtered_data','https://www.mathworks.com/matlabcentral/answers/uploa...

18 days ago | 0

| accepted

Answered

denoise non stationary signal

I have nothing against using wavelets to denoise a signal, however I generally find the sgolayfilt function useful in eliminatin...

denoise non stationary signal

I have nothing against using wavelets to denoise a signal, however I generally find the sgolayfilt function useful in eliminatin...

19 days ago | 0

| accepted

Answered

plot a time series data

Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1120695/sample.csv', 'VariableNaming...

plot a time series data

Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1120695/sample.csv', 'VariableNaming...

19 days ago | 0

| accepted

Answered

how to draw a cube with planes

This is generally how to draw the patch plots in 3D. You organised them well, however they still need a bit of revision to pl...

how to draw a cube with planes

This is generally how to draw the patch plots in 3D. You organised them well, however they still need a bit of revision to pl...

19 days ago | 1

| accepted

Answered

How do you integrate a very long equation on MATLAB?

Use the vpaintegral function — syms x y = 0.5+x^0.6532; %incremental surface yuse = sqrt(1+(diff(y))^2); %pressure along t...

How do you integrate a very long equation on MATLAB?

Use the vpaintegral function — syms x y = 0.5+x^0.6532; %incremental surface yuse = sqrt(1+(diff(y))^2); %pressure along t...

19 days ago | 0