Answered

How to extract phase information from freqs?

Instead of atand(imag(H)./real(H)) please try using angle(H)*180/pi

How to extract phase information from freqs?

Instead of atand(imag(H)./real(H)) please try using angle(H)*180/pi

mer än 8 år ago | 1

| accepted

Answered

how to convert file.m into block in Simulink ?

Have you tried using the MATLAB Function block? It's in the User Defined Functions sub-library in base Simulink.

how to convert file.m into block in Simulink ?

Have you tried using the MATLAB Function block? It's in the User Defined Functions sub-library in base Simulink.

mer än 8 år ago | 0

Answered

Compute cumulative sum of a singal for a certain period of time (moving sum)

You can use a <http://www.mathworks.com/help/simulink/slref/discretefirfilter.html Discrete FIR Filter> with coefficients of |on...

Compute cumulative sum of a singal for a certain period of time (moving sum)

You can use a <http://www.mathworks.com/help/simulink/slref/discretefirfilter.html Discrete FIR Filter> with coefficients of |on...

mer än 8 år ago | 2

| accepted

Answered

How to find location of points used to calculate width of peaks using findpeaks function?

Although not ideal, here is a workaround that might help: ax = gca; lines = ax.Children; x = lines(1).XData'; ...

How to find location of points used to calculate width of peaks using findpeaks function?

Although not ideal, here is a workaround that might help: ax = gca; lines = ax.Children; x = lines(1).XData'; ...

mer än 8 år ago | 1

Answered

Fourier transform, Position to Jerk differentiation

|fftshift| does *not* compute the Fourier Transform. You need to use the |fft| function in conjunction with |fftshift|, as: ...

Fourier transform, Position to Jerk differentiation

|fftshift| does *not* compute the Fourier Transform. You need to use the |fft| function in conjunction with |fftshift|, as: ...

mer än 8 år ago | 0

| accepted

Answered

Computing and Ploting Fourier transform

Fs = 8; dt = 1/Fs; N = 8000; t = dt*(-N/2:N/2-1)'; dF = Fs/N; f = -Fs/2:dF:Fs/2-dF; p = heaviside(t+1)...

Computing and Ploting Fourier transform

Fs = 8; dt = 1/Fs; N = 8000; t = dt*(-N/2:N/2-1)'; dF = Fs/N; f = -Fs/2:dF:Fs/2-dF; p = heaviside(t+1)...

mer än 8 år ago | 0

| accepted

Answered

I want to create a GUI with two sets of radio buttons, one edit and a pushbutton to continue. I cant isolate the two sets of radio buttons into two differente groups so they wont interact with eachother. only one option can be selected at a time each

Please include the button group's handle |bg| or |bg2| as the first argument that you pass to |uncontrol| function for each ra...

I want to create a GUI with two sets of radio buttons, one edit and a pushbutton to continue. I cant isolate the two sets of radio buttons into two differente groups so they wont interact with eachother. only one option can be selected at a time each

Please include the button group's handle |bg| or |bg2| as the first argument that you pass to |uncontrol| function for each ra...

mer än 8 år ago | 0

Answered

High quality spectrogram with a few seconds signal

Please try the following: % Window duration (in seconds): dur = 0.5; % Spectrogram settings (in samples): wi...

High quality spectrogram with a few seconds signal

Please try the following: % Window duration (in seconds): dur = 0.5; % Spectrogram settings (in samples): wi...

mer än 8 år ago | 1

Answered

how to make a fft code for magnetics field analysis?

X = fft(x);

how to make a fft code for magnetics field analysis?

X = fft(x);

mer än 8 år ago | 0

| accepted

Answered

Why is there a time difference in tic toc in multiple runs

Because |tic toc| measures _elapsed_ time rather than _cpu_ time. Try using |profile| instead.

Why is there a time difference in tic toc in multiple runs

Because |tic toc| measures _elapsed_ time rather than _cpu_ time. Try using |profile| instead.

mer än 8 år ago | 0

Answered

FFT result looks nothing like analytic result

steps = 2^10; lim = 4; dx = 2*lim/steps; x = -lim:dx:lim-dx; % x = linspace(-lim, lim, steps); Fs = 1/dx; dF ...

FFT result looks nothing like analytic result

steps = 2^10; lim = 4; dx = 2*lim/steps; x = -lim:dx:lim-dx; % x = linspace(-lim, lim, steps); Fs = 1/dx; dF ...

mer än 8 år ago | 1

Answered

How to replicate a hexagon pattern in a given area of 100x100

function draw_pattern r = 2; dx = r; dy = r*sin(pi/3); figure; axes; hold...

How to replicate a hexagon pattern in a given area of 100x100

function draw_pattern r = 2; dx = r; dy = r*sin(pi/3); figure; axes; hold...

mer än 8 år ago | 0

| accepted

Answered

Help plotting FFT from column vector with real and imaginary parts.

N = length(data); freq = fftshift(fft(data))/N; plot(abs(freq));

Help plotting FFT from column vector with real and imaginary parts.

N = length(data); freq = fftshift(fft(data))/N; plot(abs(freq));

mer än 8 år ago | 3

| accepted

Answered

How to generate 100 sample points of a 3-state Markov chain with initial prob vector and transition probability matrix using inverse transform method on matlab.

Here's a start: P = [0.3 0.1 0.1; 0.3 0.9 0.1; 0.4 0 0.8]; % Transition Matrix P0 = [0.1 0.9 0]; %initial probability...

How to generate 100 sample points of a 3-state Markov chain with initial prob vector and transition probability matrix using inverse transform method on matlab.

Here's a start: P = [0.3 0.1 0.1; 0.3 0.9 0.1; 0.4 0 0.8]; % Transition Matrix P0 = [0.1 0.9 0]; %initial probability...

mer än 8 år ago | 0

| accepted

Answered

How can I replace every element of a matrix with a special character to hide the element

x = magic(3); y = repmat('*',size(x)); disp(y);

How can I replace every element of a matrix with a special character to hide the element

x = magic(3); y = repmat('*',size(x)); disp(y);

mer än 8 år ago | 0

| accepted

Answered

How can I replace every element of a matrix with a special character to hide the element

x = magic(3); x(x<7) = NaN; disp(x);

How can I replace every element of a matrix with a special character to hide the element

x = magic(3); x(x<7) = NaN; disp(x);

mer än 8 år ago | 0

Answered

how can find frequency from an fft function?

Fs = 40; % samples per second N = length(Y1); % samples dF = Fs/N; % h...

how can find frequency from an fft function?

Fs = 40; % samples per second N = length(Y1); % samples dF = Fs/N; % h...

mer än 8 år ago | 1

Answered

Unable to obtain 50 Hertz sine wave in Simulink

Please try zooming in using the horizontally-constrained zoom tool.

Unable to obtain 50 Hertz sine wave in Simulink

Please try zooming in using the horizontally-constrained zoom tool.

mer än 8 år ago | 0

Answered

How to plot the frequency response of a discrete cosine function?

L = 1000; n = 0:L-1; x1 = fftshift(fft(x))/L; dw = 2*pi/L; w = -pi:dw:pi-dw; stem(w,mag);

How to plot the frequency response of a discrete cosine function?

L = 1000; n = 0:L-1; x1 = fftshift(fft(x))/L; dw = 2*pi/L; w = -pi:dw:pi-dw; stem(w,mag);

mer än 8 år ago | 0

Answered

I have fft data. How can I predict from the fft data whether the data is of sine or cosine wave?

You can tell from the phase. If the phase is 0 degrees, then it's a cosine. If the phase is -90 degrees, then it's a sine. If...

I have fft data. How can I predict from the fft data whether the data is of sine or cosine wave?

You can tell from the phase. If the phase is 0 degrees, then it's a cosine. If the phase is -90 degrees, then it's a sine. If...

mer än 8 år ago | 2

Answered

FFT plot of velocity

Please try the following experiment: Fs = 48000; dt = 1/Fs; t = (0:dt:0.25-dt)'; A = 5; x = A*ones(size(t)); ...

FFT plot of velocity

Please try the following experiment: Fs = 48000; dt = 1/Fs; t = (0:dt:0.25-dt)'; A = 5; x = A*ones(size(t)); ...

mer än 8 år ago | 0

Answered

how to generate a square wave with a fundamental frequency of 50hz?

>> doc square

how to generate a square wave with a fundamental frequency of 50hz?

>> doc square

mer än 8 år ago | 0

Answered

FFT plot of velocity

Please review: <http://www.mathworks.com/matlabcentral/answers/15770-scaling-the-fft-and-the-ifft Scaling the FFT and the IFFT>...

FFT plot of velocity

Please review: <http://www.mathworks.com/matlabcentral/answers/15770-scaling-the-fft-and-the-ifft Scaling the FFT and the IFFT>...

mer än 8 år ago | 0

Solved

MATLAB Basic: rounding

Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8

mer än 8 år ago

Solved

Sum the squares of numbers from 1 to n

For a given value of n return the sum of square of numbers from 1 to n. Example For n = 2 then sum of squares = 5 (1^2 + ...

mer än 8 år ago

Answered

How to design a notch filter that stops the 2 kHz ,with sampling rate 8 kHz,and plot the magnitude response,also plot pole zero locations ?

Here's a start: Fs = 8000; % samples per second Fc = 2000; % hertz phi = 2*pi*Fc/Fs; % radians...

How to design a notch filter that stops the 2 kHz ,with sampling rate 8 kHz,and plot the magnitude response,also plot pole zero locations ?

Here's a start: Fs = 8000; % samples per second Fc = 2000; % hertz phi = 2*pi*Fc/Fs; % radians...

mer än 8 år ago | 0

| accepted

Answered

What am I doing wrong in my code? Trying to detect if array has NaN.

if any(isnan(x))

What am I doing wrong in my code? Trying to detect if array has NaN.

if any(isnan(x))

mer än 8 år ago | 0

Answered

Two mass damper spring system in simulink

You can represent each mass as a series combination of an integrator and a gain. The value of the gain will be either |M| or |1...

Two mass damper spring system in simulink

You can represent each mass as a series combination of an integrator and a gain. The value of the gain will be either |M| or |1...

mer än 8 år ago | 1

| accepted