Answered
how to define a frequenty domain to do an FFT over?
It would help to have an example. The fft function requires that the original data be sampled at regular intervals. The easi...

13 days ago | 0

| accepted

Answered
How can I optimize the FFT of very large arrays
One option may be to be certain that the original signal so that its length is zero-padded to a power of 2: Fs = 256; t = lin...

13 days ago | 0

Answered
How to find second order transfer function of tfestimate result
The tfestimate function may not be the funciton you want. Instead, use invfreqs (continuous) or invfreqz (sampled) to estimate ...

13 days ago | 1

| accepted

Answered
How can we threshold a signal in both positive and negative sides?
I am not certain what you want as the result. The for loop and if block are not necessary. You can do this with logical inde...

13 days ago | 0

Answered
How do you remove non-integer values from a colorbar?
This required some coding gymnastics, however it may be what you want — cm = [1 0 0; 1 1 1; 0 0 1]; % Basi...

14 days ago | 1

Answered
lsqcurvefit with custom equation
There is a problem with ‘f’ since it is not obvioul what parameters are to be estimated. The function should be: f(parameter_...

14 days ago | 0

| accepted

Answered
How do you remove tick marks (not labels) from a colorbar?
Try this — cm = [1 0 0; 1 1 1; 0 0 1]; % Basic Colormap cmi = interp1([-2; 0; 5], cm, (-2:5)) %...

14 days ago | 1

| accepted

Answered
Double conversion to use prctile function
I am not certain what ‘Model’ is, however if it resembles this array, indexing into it as a cell array is straightforward — Mo...

14 days ago | 1

| accepted

Answered
Convert x y coordinates and z data to Matrix
It would help to have the actual vectors. It may be possible to use the reshape function to create matrices from the vectors,...

14 days ago | 0

| accepted

Answered
How do I make a red and blue colormap?
I am not exactly certain what you want, however the basic colormap is easy to create — cm = [1 0 0; 1 1 1; 0 0 1]; ...

14 days ago | 0

| accepted

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

18 days ago | 1

| accepted

Load more