Answered
Strange form of increasing when derivating sine waves
I think you're seeing the effect of the discrete time step combined with numerical approximations to the differentiation and the...

5 years ago | 0

| accepted

Answered
Using ODE1 in Simulink yields different results for an equivalent model run in a for loop
I think some of the equations are out of order. I got a match (obviously using my inputs) with this: h = Ts; %sample period q...

5 years ago | 0

Answered
How to make state space for two or more inputs with same number of state variables
Without seeing the code that constructs the model, it's unclear if the desired end state is even achievable. You can always try ...

5 years ago | 0

Answered
[DISCONTINUED] MATLAB Answers Wish-list #5 (and bug reports)
After I click the "Follow" link on a question, I'd like that question to show up in my Managed Followed Content list immediately...

5 years ago | 1

Answered
How were the matrices for A G and C derived in this answer
The matrices are not developed by linearizing and then discretizing the nonlinear differential equation. The doc says that they...

5 years ago | 1

Answered
How to get rid of sign() in diff() results?
If the goal is to get an expression for the amplitude of the frequency response of H(s) and then differentiate ... syms R1 R2 C...

5 years ago | 0

| accepted

Answered
zero frequency amplitude issue at fft
In the third plot, the data tip is not at X = 0 (as is the case with the first two plots). Try zooming in and picking the actua...

5 years ago | 0

Answered
Difference between eigs and svds
eigs returns eigenvalues and eigenvectors. svds resturns singular valuese and singular vectors. Why would there be an expectat...

5 years ago | 0

Answered
MATLAB can't compute a closed-loop final-value theorem on a controller.
Is that feedback gain matrix correct? Note that here I'm using K, but the code above used k1 and k2, which were not defined. Ph...

5 years ago | 0

| accepted

Answered
Element by element multiplication of a matrix
For the matrix exponential: % example data H = [1 2;3 4]; t = 0:5; f = cell2mat(cellfun(@expm,mat2cell(H.*reshape(t,1,1,[]),...

5 years ago | 0

Answered
a problem with pade approximation
tf objects have three delay properties: InputDelay, OutputDelay, and IODelay. Look at all three of these properties for each ele...

5 years ago | 0

| accepted

Answered
Demux and State Space Dimension errors
If the output of the State Space block has four elements, then set the "Number of outputs" parameter of the Demux block to 4.

5 years ago | 0

Answered
Plotting lsim directly results in different plot when writing to variables first
plot() is a general purpose plotting function and has no way of knowing that the inputs to be plotted represent sample times and...

5 years ago | 0

Answered
Area between two curves without intersection
I think this is what you're looking for: x=[0,-1.66128688049154,-3.71843384492024,-6.03903044153544,-8.52179344691878,-11.06847...

5 years ago | 0

Answered
Conflicting Simulink mdoels - transfer function
The block diagrams don't represent the same system. The easiest way to see this is that the loop transfer functions are differen...

5 years ago | 0

| accepted

Answered
Multivariate normal random numbers vs. random numbers from normal distribution
I'm not quite sure what you did to create y, since the code generates y as a single column. It looks like y was produced by: m...

5 years ago | 1

Answered
generating wrong Nyquist plot of tf
Keep in mind that nyquist() doesn't draw the arc at infinity due to the double pole at the origin. If you zoom in around the or...

5 years ago | 0

| accepted

Answered
numerical curl vs symbolic curl
In addition to fixing the meshgrid per the comment above ... The eigenvectors Uk are normalized differently between the symboli...

5 years ago | 0

Answered
How can I exchange sqrt(-1) with 1i
I thought that all that would be needed is to assume that g is positive: syms g positive sqrt(-g) Alas, this approach doesn't...

5 years ago | 0

| accepted

Answered
Sorting complex array with cplxpair and how to get the sort index?
ismember() might be what you're looking for. Do you care about how this works if the elements of k are not all unique? k = [ ...

5 years ago | 0

| accepted

Answered
How make symbolic variables to a power equal to zero
syms a t Iy = [16*t^3 / a, a^2 * t] Iy(polynomialDegree(Iy,t)>1) = sym(0)

5 years ago | 0

Answered
Plotting General Solution Of Differential Equation
Need to add one line of code syms y(x) D4y = diff(y,4); D3y = diff(y,3); D2y = diff(y,2); Dy = diff(y); eq= D4y +(2.*D3y)+...

5 years ago | 0

Answered
How do I pass a transfer function as a variable in Simulink?
Yes, you can use either a Transfer Fcn block or an LTI System block. Suppose h is a tf object in the base workspace. For the Tr...

5 years ago | 3

Question


Why Does eig() Not Throw an Error for Non-Square, Symbolic Input?
Example: M = [sym(zeros(2));sym('m',[2 2])]; M(1,1) = 1 eig(M) But filling in the top partition of M does yield the expected...

5 years ago | 1 answer | 0

1

answer

Answered
How to evaluate frequency response of a filter using freqz()?
Image 1 is plotted against against magnitude, not magnitude(dB). Just change the second input to plot() to be the db of the mag...

5 years ago | 0

Answered
How to put step reference command on Simulink?
Constant = 5, feeds a Discrete Tansfer Fcn block with Numerator = 1, Denominator = [1 -1] and Sample Time = 3

5 years ago | 0

| accepted

Answered
Is my Fourier Transform code correct?
Why whould this approach be expected to exactly recover the original signal? The DFT of the original signal is not zero everwher...

5 years ago | 1

Answered
Step Response and Root Locus are give me different answers
The information in the datatip on the root locus plot is only applicable for a response defined by that pole location (and its c...

5 years ago | 1

| accepted

Answered
Fourier transform of sum of sinusoids
The exact Fourier transform can be found as: syms w1 w2 w3 t w f(t)=sin(w1*t)+sin(w2*t)+sin(w3*t); F(w)=fourier(f(t),t,w)

5 years ago | 0

| accepted

Answered
coeffs of symbolic equation
Is this what you're looking for: syms x y z=x+2*x*y+4.*y+5*x*y^2; [cxy,t]=coeffs(z,[x y])

5 years ago | 0

| accepted

Load more