fft2: Frequency and wavenumber
Take a look at my post here for an idea of what is output from FFT2: <http://www.mathworks.com/matlabcentral/answers/24965-ff...

10 years ago | 0

| accepted

Gaussian FFT
Try plotting the absolute value of the frequency domain amplitudes... when your Gaussian is not centered at time 0, the phase ma...

10 years ago | 1

| accepted

Anyone using MATLAB on a LINUX OS??
Works fine for me on Redhat... running it on a 12-core, 96GB machine at work. Any simple-ish benchmarks you looking to test/meas...

10 years ago | 0

I want to plot PSD for my input data(meters)
If you are measuring displacement in meters in the time domain, then your frequency domain amplitudes (after performing the FFT)...

10 years ago | 0

| accepted

Difference between fft and manually coding for a fourier transform
You are not correctly defining the frequencies "k" that are associated with the amplitudes in the frequency domain, but it start...

10 years ago | 0

| accepted

Scaling of fft output?
See my answer here: <http://www.mathworks.com/matlabcentral/answers/15770-scaling-the-fft-and-the-ifft> In order to conse...

10 years ago | 0

Is there any alternative to if statements inside for loops?
Do you pre-allocated "Pin", if not... then before the for-loops put: Pin = zeros(8760,Ni); The inside of your for-loops ...

10 years ago | 0

impulse response interpretation
I reran through the process of generating the Frequency Response data (G) using your code and the one from the FEX just to see i...

10 years ago | 0

from time domain to frequency domain and back to time domain
Your "X" has shifted the zero frequency amplitude to the center. You need to use *ifftshift* to get it back where Matlab expects...

10 years ago | 0

| accepted

I cant generate a square wave in matlab using the square wave command
If you dont have the Signal Processing Toolbox, will the following work as an alternative: y = sign(sin(2*pi*100*t));

10 years ago | 1

obtain the Impulse response from a frequency response
N = 1000; % Number of samples df = 20; % Frequency increment (in Hertz) Nyq = 10000; % Nyquist Frequency (in Hertz) ...

10 years ago | 4

| accepted

Can my integration code for an accelerometer data work for a Square wave?
Instead of trying to convert using your code, try mine located here: <http://www.mathworks.com/matlabcentral/answers/21700-fi...

10 years ago | 0

| accepted

Help With Plot Legend
If you are just trying to apply the 3 legend strings to 3 lines on a plot, then all you need to do is: legend(cell) Take...

10 years ago | 0

What does x(1,:) do in MATLAB ?
"a0" is the Fourier Transform of the first row of "at" at(2,:) % gives the second row at(3,:) % gives the third row (and s...

10 years ago | 12

| accepted

Interpreting frequency using pwelch function
1/26.0893 years per sample equals roughly 1208771.41 seconds per sample, which is roughly equivalent to an Fs of 8.27286276e-07 ...

10 years ago | 0

if statement for range of array values
I think what you might be after is something like: if all(x(i-1:i+1) < xmax) || all(y(i-1:i+1) < ymax) % something e...

10 years ago | 0

Rows
a = rand(1000,5); b = min(a,[],2);

10 years ago | 1

| accepted

The way it is implemented above, the value at 0 frequency is just the sum of your signal from -1 seconds to 1 second (you have a...

10 years ago | 0

quick easy question
It looks like "t" is an array of numbers, therefore you need to incorporate a "." before you multiply "(B1*cos*(Omega_d*t) + B2*...

10 years ago | 0

Create a array of 1 and -1
Not the most efficient, but: >> a=nchoosek([1,2,3,4,5,6,7,8],4); >> b = ones(size(a)); >> b(mod(a,2)==0) = b(mod(a,2)==0)...

10 years ago | 0

FFT single-sided amplitude spectrum plot spike at 1Hz of accelerometer data
As a general rule of thumb, I will remove any trend and/or mean from the data before I run it through FFT.

10 years ago | 0

| accepted

why fgetl read spaces?
If they are all just numbers on the line, then converted the string to numeric should do the trick new_t = str2num(t);

10 years ago | 1

Matrix of statuses or matching; discrete one-to-one mapping
You can't do this with any old NxK matrix, it must be a square NxN matrix. Otherwise your condition, that the sums of individual...

10 years ago | 0

| accepted

plotting the frequency spectrum
Your "f" looks off. For your configuration (which uses fftshift): N = length(y); dt = x(2)-x(1); % Time increment Nyq = 1...

10 years ago | 0

How to extract correct FFT?
Just to eliminate a few things, try this: dt = time(2)-time(1); Fs = 1/dt; M = length(gage); N = pow2(nextpow2(M)); ...

10 years ago | 0

| accepted

Alternative to using "unix(sprintf('ls %s/*/*/*.out',pathname))" ?
I ran a test... Running this from Matlab: [~,List] = unix(sprintf('ls %s/*/*/*.out',pathname)); And then doing some m...

10 years ago | 0

| accepted

How to create 'density' plot from 2d scatter data
Check out the example for *hist3* in the Help navigation window... maybe useful here.

10 years ago | 1

combine ARRAYS
doc cat This should work, too: C = [A ; B];

10 years ago | 0

| accepted