Answered

Trying to find square of "control system"

Declare the control gains and frequency as real. syms P_slozka real; % kp syms I_slozka real; %T_I syms D_slozka real; %T_D ...

Trying to find square of "control system"

Declare the control gains and frequency as real. syms P_slozka real; % kp syms I_slozka real; %T_I syms D_slozka real; %T_D ...

25 dagar ago | 0

| accepted

Answered

Im trying to convolute a rect function and a sinc function

Because Gz is a variable, not a function, Gz(z) is trying to use the vector z as an index into the variable Gz. But z contains ...

Im trying to convolute a rect function and a sinc function

Because Gz is a variable, not a function, Gz(z) is trying to use the vector z as an index into the variable Gz. But z contains ...

25 dagar ago | 0

Answered

design error of closed loop linear quadratic gaussian(LQG) regulator

Hi @Jun Seung Mun I think there are a few issues with the code. First, the plant should have at least one input for the control...

design error of closed loop linear quadratic gaussian(LQG) regulator

Hi @Jun Seung Mun I think there are a few issues with the code. First, the plant should have at least one input for the control...

25 dagar ago | 0

Answered

I want to replace more than 1 random words in a sentence with "___" using matrices. I can type it out long hand but want to avoid this.

Hi Cade, It would be helpful to include an example input and show what the desired output should be. As best I can tell, maybe...

I want to replace more than 1 random words in a sentence with "___" using matrices. I can type it out long hand but want to avoid this.

Hi Cade, It would be helpful to include an example input and show what the desired output should be. As best I can tell, maybe...

28 dagar ago | 0

Answered

Difference between lhsnorm and normrnd

The doc page for lhsnorm is surprisingly sparse. But it does talk about the multi-variable normal distribution, in which case si...

Difference between lhsnorm and normrnd

The doc page for lhsnorm is surprisingly sparse. But it does talk about the multi-variable normal distribution, in which case si...

28 dagar ago | 0

| accepted

Answered

How do I reverse the effect of an integral block?

Hi Janith Are you sure the encoder is a pure differentiator? Even if it is, the simulation is likely to have problems with the...

How do I reverse the effect of an integral block?

Hi Janith Are you sure the encoder is a pure differentiator? Even if it is, the simulation is likely to have problems with the...

28 dagar ago | 0

| accepted

Answered

Can FILTFILT(B, A, X) yeild the same results as FILTFILT(SOS, G, X) assuming inputs are generated via [z,p,k] = butter(3,Wn) + [sos,g] = zp2sos(z,p,k) and [A,B] = butter(3,Wn)

Hello Chris, Here's the code I ran (unknown to me, butter() assumes a bandpass by default with a two-element frequency vector, ...

Can FILTFILT(B, A, X) yeild the same results as FILTFILT(SOS, G, X) assuming inputs are generated via [z,p,k] = butter(3,Wn) + [sos,g] = zp2sos(z,p,k) and [A,B] = butter(3,Wn)

Hello Chris, Here's the code I ran (unknown to me, butter() assumes a bandpass by default with a two-element frequency vector, ...

29 dagar ago | 1

| accepted

Answered

Why does integrating my signal attenuate it?

Hi Janith, If the input to the integrator block is u(t) = sin(w*t), the output of the integrator will be y(t) = -1/w*cos(w*t) ...

Why does integrating my signal attenuate it?

Hi Janith, If the input to the integrator block is u(t) = sin(w*t), the output of the integrator will be y(t) = -1/w*cos(w*t) ...

30 dagar ago | 2

| accepted

Answered

What is the best way to make bodemag of multiple MIMO systems distinguishable? Markers?

Hi @Bruno Dogancic Here's some code to put an 'o' marker on every 10th data point. Adapt as needed to change markers, line styl...

What is the best way to make bodemag of multiple MIMO systems distinguishable? Markers?

Hi @Bruno Dogancic Here's some code to put an 'o' marker on every 10th data point. Adapt as needed to change markers, line styl...

ungefär en månad ago | 0

| accepted

Answered

How can i force simulink to use a set of data from another simulink model ?

Try using the sim() command instead of set_param. I had trouble with the latter, but no problems with the former. This code wo...

How can i force simulink to use a set of data from another simulink model ?

Try using the sim() command instead of set_param. I had trouble with the latter, but no problems with the former. This code wo...

ungefär en månad ago | 0

| accepted

Answered

Is there a function like "y = filter(b,a,x,zi) uses initial conditions zi for the filter delays" in fftfilt? If not, what's the most efficient way to implement this?

Filtering is a linear operation so the iniital condition response and the input response can be computed separately and then add...

Is there a function like "y = filter(b,a,x,zi) uses initial conditions zi for the filter delays" in fftfilt? If not, what's the most efficient way to implement this?

Filtering is a linear operation so the iniital condition response and the input response can be computed separately and then add...

ungefär en månad ago | 1

| accepted

Answered

How to put this transfer function into simulink

The transfer function in question syms s H(s) = -(1 - 0.5*exp(-10*s))/(40*s + 1)/(15*s + 1) Starting from a single input sign...

How to put this transfer function into simulink

The transfer function in question syms s H(s) = -(1 - 0.5*exp(-10*s))/(40*s + 1)/(15*s + 1) Starting from a single input sign...

ungefär en månad ago | 0

Answered

How to get simplified, symbolic solutions for definite integrals

Declare x w to be real syms x w real fn1 = exp(-abs(x))*cos(w*x) int(fn1, x, [-inf inf])/sym(pi)

How to get simplified, symbolic solutions for definite integrals

Declare x w to be real syms x w real fn1 = exp(-abs(x))*cos(w*x) int(fn1, x, [-inf inf])/sym(pi)

ungefär en månad ago | 0

| accepted

Answered

I am trying to use the rectangular pulse function, but I am not sure how to use it correctly to solve a Fourier problem.

Hi Connor, This question brings up some interesting aspects of Fourier analysis, and how transforms of the discrete-time sample...

I am trying to use the rectangular pulse function, but I am not sure how to use it correctly to solve a Fourier problem.

Hi Connor, This question brings up some interesting aspects of Fourier analysis, and how transforms of the discrete-time sample...

ungefär en månad ago | 0

Answered

Matlab and Routh criterion for evaluation of K for stability

Hi @omar khasawneh, Without a value for K I think you'll need to use the Symbolic Math Toolbox. Your code adapts easily. I did ...

Matlab and Routh criterion for evaluation of K for stability

Hi @omar khasawneh, Without a value for K I think you'll need to use the Symbolic Math Toolbox. Your code adapts easily. I did ...

ungefär en månad ago | 1

| accepted

Answered

Lsim inputs inversion provide the same result

Interesting. A quick look at the code, at least for the case where an output argument is specified, shows that the function tha...

Lsim inputs inversion provide the same result

Interesting. A quick look at the code, at least for the case where an output argument is specified, shows that the function tha...

ungefär en månad ago | 1

| accepted

Answered

FFT of the average vs average of the FFT

For a matrix input, fft() works down the columns. Maybe this: rng(100); S = rand(5); fft(mean(S,1)) % mean for each column,...

FFT of the average vs average of the FFT

For a matrix input, fft() works down the columns. Maybe this: rng(100); S = rand(5); fft(mean(S,1)) % mean for each column,...

ungefär en månad ago | 0

Answered

Continuous Convolution in Time Domain

Hello @Masoud Nateghi The code needs to use the full convolution sum to approximate the convolution integral. Also, because the...

Continuous Convolution in Time Domain

Hello @Masoud Nateghi The code needs to use the full convolution sum to approximate the convolution integral. Also, because the...

ungefär en månad ago | 0

| accepted

Answered

Impulse and step response differences

Hello @Arcadius, The differential equation in the Question is ambiguously written. Your solution for the impulse response assum...

Impulse and step response differences

Hello @Arcadius, The differential equation in the Question is ambiguously written. Your solution for the impulse response assum...

ungefär en månad ago | 1

| accepted

Answered

FFT of Gaussian filter in 1D

Hello @Donya Khaledyan The code in the question doesn't define t nor FGHE2, so the plots can't be recreated. Code below might b...

FFT of Gaussian filter in 1D

Hello @Donya Khaledyan The code in the question doesn't define t nor FGHE2, so the plots can't be recreated. Code below might b...

ungefär en månad ago | 1

Answered

Find indices of multiple strings within another string

It looks like using string variables with an inner loop is much faster than a cell array with cellfun, at least here on Answers ...

Find indices of multiple strings within another string

It looks like using string variables with an inner loop is much faster than a cell array with cellfun, at least here on Answers ...

ungefär en månad ago | 0

| accepted

Answered

How to do Pade approximation with different order of numerator and denominator in Matlab

The Sybolic Math Toolbox has a function pade() where the order of the numerator and denominator can be specified separately. The...

How to do Pade approximation with different order of numerator and denominator in Matlab

The Sybolic Math Toolbox has a function pade() where the order of the numerator and denominator can be specified separately. The...

ungefär en månad ago | 0

| accepted

Answered

Root Locus system description at given point not showing up

Is there any chance that you have some local version of rlocus() that is shadowing the Control System Toolbox? What is the outpu...

Root Locus system description at given point not showing up

Is there any chance that you have some local version of rlocus() that is shadowing the Control System Toolbox? What is the outpu...

ungefär en månad ago | 1

Answered

Analog Bessel filter output problem (nan)

The num and den inputs to filtfilt() are for a discrete-time filter. But besself() returns the numerator/denominator for a cont...

Analog Bessel filter output problem (nan)

The num and den inputs to filtfilt() are for a discrete-time filter. But besself() returns the numerator/denominator for a cont...

ungefär en månad ago | 0

Answered

Fourier expansion of dirac delta function

Increasing n to better approximate the infinte sum yields L=10; F0=10000; v0=1; t=4; x=-10:0.1:10; n=400; f=0; for i=1:n...

Fourier expansion of dirac delta function

Increasing n to better approximate the infinte sum yields L=10; F0=10000; v0=1; t=4; x=-10:0.1:10; n=400; f=0; for i=1:n...

ungefär en månad ago | 0

| accepted

Answered

squeeze function returning "NaN"

squeeze() can't ignore anything. If the input to squeez() is 1 x 1 x 33 matrix of NaN, the ouptut will be 33 x 1 of NaN. What ...

squeeze function returning "NaN"

squeeze() can't ignore anything. If the input to squeez() is 1 x 1 x 33 matrix of NaN, the ouptut will be 33 x 1 of NaN. What ...

ungefär en månad ago | 0

Answered

Sum in two variables for response of NON-LTI discrete time system

Hi @ALESSIO MANIÀ 1. The loop should be over n, beause each time through the loop it should be computing y(ni), i.e., a single ...

Sum in two variables for response of NON-LTI discrete time system

Hi @ALESSIO MANIÀ 1. The loop should be over n, beause each time through the loop it should be computing y(ni), i.e., a single ...

ungefär en månad ago | 0

| accepted

Answered

How can I normalize my filter?

Hi @Amy Lg Why is fs defined and then multiplied by 1e9 in the call to bilinear? Which I guess might be o.k. but perhaps isn't...

How can I normalize my filter?

Hi @Amy Lg Why is fs defined and then multiplied by 1e9 in the call to bilinear? Which I guess might be o.k. but perhaps isn't...

ungefär en månad ago | 0

| accepted

Question

Is There a Way to disp a sym Double Subscript?

dips() works fine with a single subscript disp(str2sym("E_omega")) Double subscript looks odd disp(str2sym("E_omega_n")) Any...

ungefär 2 månader ago | 1 answer | 0

Answered

What does my Root Locus response mean? Why is it different?

Hello @Joel Okanta The root locus is much more general than as suggested in the Question. Given a system described by an open l...

What does my Root Locus response mean? Why is it different?

Hello @Joel Okanta The root locus is much more general than as suggested in the Question. Given a system described by an open l...

ungefär 2 månader ago | 0