Answered

MATLAB Answers Wish-list #2 (and bug reports)

I kind of wish that when we scrolled through the answers to questions (especially when there are many "answers" like this one), ...

MATLAB Answers Wish-list #2 (and bug reports)

I kind of wish that when we scrolled through the answers to questions (especially when there are many "answers" like this one), ...

etwa 7 Jahre ago | 0

Answered

Is there a built-in function that determines whether X/Y coordinates give valid polygon?

My attempt: % Assume polygon is valid answer = 1; % Set tolerance tol = 0.001; % Random set...

Is there a built-in function that determines whether X/Y coordinates give valid polygon?

My attempt: % Assume polygon is valid answer = 1; % Set tolerance tol = 0.001; % Random set...

etwa 7 Jahre ago | 0

Question

Is there a built-in function that determines whether X/Y coordinates give valid polygon?

If I have a vector of X-coordinates and a vector of Y-coordinates, is there a function that determines whether a valid polygon i...

etwa 7 Jahre ago | 3 answers | 1

Answered

How do you centre your plot at '0' on the X-axis after performing a Fourier transform?

*fftshift* might be what you are looking for. Does this example help? dt = 0.1; % Fs = 1/dt; N = 16; t = (0:N-1)*dt; ...

How do you centre your plot at '0' on the X-axis after performing a Fourier transform?

*fftshift* might be what you are looking for. Does this example help? dt = 0.1; % Fs = 1/dt; N = 16; t = (0:N-1)*dt; ...

etwa 7 Jahre ago | 0

Answered

how is a Shock response spectrum estimated

You might take a look at this FEX submission: <http://www.mathworks.com/matlabcentral/fileexchange/7398-shock-response-spectr...

how is a Shock response spectrum estimated

You might take a look at this FEX submission: <http://www.mathworks.com/matlabcentral/fileexchange/7398-shock-response-spectr...

etwa 7 Jahre ago | 0

| accepted

Answered

2D spectral energy density using fft2 - energy in spatial domain unequal to that in wavenumber domain

*[EDIT 7/06]* M=8;N=16; N=8;M=16; dx=0.1;dy=0.2; f = randn(M,N); % Energy in time domain energy_f = sum(sum(f.^2...

2D spectral energy density using fft2 - energy in spatial domain unequal to that in wavenumber domain

*[EDIT 7/06]* M=8;N=16; N=8;M=16; dx=0.1;dy=0.2; f = randn(M,N); % Energy in time domain energy_f = sum(sum(f.^2...

etwa 7 Jahre ago | 1

| accepted

Answered

How can I choose a subset of k points the farthest apart?

Added a few more tests (including your latest) and added your data (instead of just random dataset), which may be of interest. R...

How can I choose a subset of k points the farthest apart?

Added a few more tests (including your latest) and added your data (instead of just random dataset), which may be of interest. R...

etwa 7 Jahre ago | 0

Answered

Simple question for GUI

Also wanted to add a good resource for those who want to learn how to program a variety of things in Matlab GUIs: <http://www...

Simple question for GUI

Also wanted to add a good resource for those who want to learn how to program a variety of things in Matlab GUIs: <http://www...

etwa 7 Jahre ago | 0

| accepted

Answered

Bandpass Filter By Using Butter

Okan - Ambient noise is like random noise... the frequency domain response (if you were to plot the abs of the frequency domain ...

Bandpass Filter By Using Butter

Okan - Ambient noise is like random noise... the frequency domain response (if you were to plot the abs of the frequency domain ...

etwa 7 Jahre ago | 0

Answered

How can I choose a subset of k points the farthest apart?

Went with a "simple" way - tried to maximize the sum of the distances between each point in the sub-set of "n" below (similar to...

How can I choose a subset of k points the farthest apart?

Went with a "simple" way - tried to maximize the sum of the distances between each point in the sub-set of "n" below (similar to...

etwa 7 Jahre ago | 0

Answered

Legend Problem

Matlab is only doing what you tell it to. One of the places where you define your figure, you have your "hold on" just after you...

Legend Problem

Matlab is only doing what you tell it to. One of the places where you define your figure, you have your "hold on" just after you...

etwa 7 Jahre ago | 0

Answered

MATLAB Answers Wish-list #2 (and bug reports)

Has someone already addressed the change from having our most recent answers listed first to (now) where our oldest answers are ...

MATLAB Answers Wish-list #2 (and bug reports)

Has someone already addressed the change from having our most recent answers listed first to (now) where our oldest answers are ...

etwa 7 Jahre ago | 1

Answered

FFT

Your first amplitude represents 0 frequency. When your data has 0 mean, your first amplitude should also be 0.

FFT

Your first amplitude represents 0 frequency. When your data has 0 mean, your first amplitude should also be 0.

etwa 7 Jahre ago | 0

Answered

derivative using FFT properties

Based on the website below: <http://www.cl.cam.ac.uk/teaching/2000/ContMaths/JGD-notes/node11.html> I believe you would do...

derivative using FFT properties

Based on the website below: <http://www.cl.cam.ac.uk/teaching/2000/ContMaths/JGD-notes/node11.html> I believe you would do...

etwa 7 Jahre ago | 0

| accepted

Answered

cycles/pixel to cycels/degree

See this link: <http://www.cogs.susx.ac.uk/courses/acv/matlab_demos/fft_image_demo.html> About half way down: F = fft...

cycles/pixel to cycels/degree

See this link: <http://www.cogs.susx.ac.uk/courses/acv/matlab_demos/fft_image_demo.html> About half way down: F = fft...

etwa 7 Jahre ago | 0

Answered

FFT of an image

See my answer here for a coded up description of what the 2D Fourier transform does using a random 2D image as an example (shoul...

FFT of an image

See my answer here for a coded up description of what the 2D Fourier transform does using a random 2D image as an example (shoul...

etwa 7 Jahre ago | 0

Answered

why real part of fft (exp(at)) is negative in some parts in contrary to analytical calculation of fft(exp(at))?

Try plotting the *abs* result from FFT. Basically, you will not get a purely real, all positive frequency spectrum unless your t...

why real part of fft (exp(at)) is negative in some parts in contrary to analytical calculation of fft(exp(at))?

Try plotting the *abs* result from FFT. Basically, you will not get a purely real, all positive frequency spectrum unless your t...

mehr als 7 Jahre ago | 0

Answered

Area of a triangle

How about *polyarea*? >> x = [0, 0, 4]; >> y = [0, 3, 0]; >> area1 = polyarea(x,y) area1 = 6 >> area2 =...

Area of a triangle

How about *polyarea*? >> x = [0, 0, 4]; >> y = [0, 3, 0]; >> area1 = polyarea(x,y) area1 = 6 >> area2 =...

mehr als 7 Jahre ago | 1

| accepted

Answered

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

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

mehr als 7 Jahre ago | 0

| accepted

Answered

Gaussian FFT

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

Gaussian FFT

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

mehr als 7 Jahre ago | 1

| accepted

Answered

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

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

mehr als 7 Jahre ago | 0

Answered

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

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

mehr als 7 Jahre ago | 0

| accepted

Answered

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

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

mehr als 7 Jahre ago | 0

| accepted

Answered

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

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

mehr als 7 Jahre ago | 0

Answered

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

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

mehr als 7 Jahre ago | 0

Answered

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

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

mehr als 7 Jahre ago | 0

Answered

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

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

mehr als 7 Jahre ago | 0

| accepted

Answered

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

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

mehr als 7 Jahre ago | 0

Answered

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

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

mehr als 7 Jahre ago | 4

| accepted

Answered

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

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

mehr als 7 Jahre ago | 0

| accepted