Answered
Problem with factoring a symbolic variable
If only one term contains Td_s, then syms T_u T_t T_s tau_u Tdd_u Tdd_t Tdd_s Td_u Td_t Td_s; eq = sin(T_s - T_u)*Td_s^2 + sin...

3 years ago | 0

Answered
[DISCONTINUED] MATLAB Answers Wish-list #5 (and bug reports)
I wish that the Categories feature be much more useful. Check out hte categorization of this Question: Scroll over the right ...

3 years ago | 0

Answered
Use Matlab Function Block to plot into figure created by Matlab Script
Hi Jannis, I got this model to work The code in the Matlab Function block is function y = fcn(u,t) persistent ax1 if ...

3 years ago | 0

Answered
Gain/phase margin calculated relative to -540.
Hi Jaco-Louis From the Question: "... according to the margin documentation it is supposed to return the minimum margins, which...

3 years ago | 0

Answered
z transform of a left handed sequence
Hi AlireaA You are on the right track by breaking this problem into two parts. Let's look at the first part syms n integer sy...

3 years ago | 0

| accepted

Answered
z transfer function evaluates to inaccurate value near z=1
Hi Ashish, This problem illustrates a couple of things to keep in mind when using the Control System Toolbox Here is the origi...

3 years ago | 2

Answered
Failing to plot a fourier transform
Hi Lorenzo, On the face of it, the Symbolic Math Toolbox treatment of (normalized) sinc(x) is disappointing. Perhaps there are ...

3 years ago | 1

| accepted

Answered
Infinity appears at Constant block in Simulink
That “inf” is the sample time of the constant block. As is the “D1” on the other blocks. Check the Simulink doc on sample times ...

3 years ago | 0

| accepted

Answered
How to apply the reference target for LQR or LQG controller
Hi JS, One common way to track a reference input with a Type 1 system is to use integral control by augmenting the plant with a...

3 years ago | 1

| accepted

Answered
Why am I receiving three outputs for this lsim function?
Hi Hunter k1=1; A=[0 1 0 0 ;-k1 -0.4 k1 0.4 ;0 0 0 1; 0.25 0.1 -0.25 -1.35]; B=[5;0;0;0]; C=[1 0 0 0]; D=0; x0 = C; t = 0...

3 years ago | 0

Answered
Solve differential equation to get variable
Hi Milan, I modified as follows. Not sure if this is what you're looking for: syms d_F ; syms d_F_c; syms dM_B; %syms Thet...

3 years ago | 0

| accepted

Answered
How to fix errors within double integral.
Hi @Amanda, The doc page for integral2 say that the function that defines the integrand "must accept two arrays of the same siz...

3 years ago | 0

| accepted

Answered
Having trouble with nonpolynomial equation systems
Equations 1, 2, 5, and 6 can be solved for a parametric solution under some (I hope) reasonable asumptions on the variables. I c...

3 years ago | 0

Answered
Signal dimensions inside a simulink function
Based on the error message, it sounds like you'e requried to specify the dimensions of that outport. Do you know what the dimens...

3 years ago | 0

Answered
Can anyone help understand what the blocks in this figure are and where to find them in Simulink library?
Assuming these are both from Simulink library. 1. Double click on the block. The BlockType will be at the top of the resultsing...

3 years ago | 0

Answered
location of second peaks in fft
Hi peter, The elements of the output of fft as implemented in Matlab correspond to angles around the unit circle. For an N-poin...

3 years ago | 0

| accepted

Answered
integral of two added function can't be implemented
Hi Faisal, If the plot for the answer to Q4 is corret, then does the integration really need to start from -inf? However, I su...

3 years ago | 0

Answered
Symbolic dependency apparently sometimes gives wrong answers
Hi Mohammad, This works, at least for the examples cited in this comment. Haven't tested for anything but those examples. syms...

3 years ago | 0

Answered
how to find the area between sinx and sin2x with plot on range [0,pi] as from this code its giving negative area,?
Hi Aashay, After commenting out the code for pos and negArea that wouldn't run because y is not defined (and even if was define...

3 years ago | 0

| accepted

Question


Should ztrans Work Better when Using heaviside() ?
Recently ran across peculiar behavior with ztrans. Define some variables syms n integer syms T positive Set sympref so that ...

3 years ago | 0 answers | 0

0

answers

Answered
how to make a sum of squares symbollically known to MATLAB for use in simplification
Hi Michael, simplify works for this case: syms a b c d x y z f = (a) * (b) * (c) * (1- x^2 - y^2 - z^2) * (d) assume(1 - x^...

3 years ago | 0

Answered
eigenvalue diagonalization in matlab
Does eig not provide the solution, assuming a solution exists?

3 years ago | 0

Answered
Measure Phase/Gain Margin from a different phase reference using margin()?
Hi Alex, I'd look at the problem as follows syms s T0 = sym(-97.74e3); % T0, the DC loop transmission f0 = sym(5); %...

3 years ago | 0

| accepted

Answered
How to get max of repeated values?
Can use splitapply C = [0.5000 0.5000 0.3000 1.0000 0.8000 0.3000 0.7000 0.7000 0.3000 0.4000 ...

3 years ago | 0

Answered
Getting Simulink compile-time error "Grid inputs must be vectors or the output of MESHGRID" even though I don't get that error when I try testing those lines in MATLAB
That's an odd error message insofar as interpn actually requires the the grid inputs to be the output of NDGRID (not MESHGRID) a...

3 years ago | 0

Answered
How to output a vector in MATLAB Function in Simulink?
One problem that I should have seen before is that this line [xdot_3,xdot_4] = Minv * [same stuff here]; should be temp = M_t...

3 years ago | 0

Answered
string extraction from a table
Age = [38;43;38;40;49;45;42;24;50;99]; Smoker = logical([1;0;1;0;1;1;1;0;0;1]); LastName = {'Brown_Howard';'Johnson';'Lee';'Di...

3 years ago | 0

| accepted

Question


Are Arithmetic Operations on a Cell Array of sym Objects Documented Behavior?
I inadvertently stumbled across this behavior: syms z H(z) = 1/(z+1) - 1/(z+2) c = children(H(z)) whos c c is a cell array ...

3 years ago | 0 answers | 2

0

answers

Answered
Simulink signal is double when it should be logical.
Hi Sam, Set the initial condition of the Delay block (or Unit Delay block, not sure which is being used) to false or true as de...

3 years ago | 0

| accepted

Answered
Displaying sum on plot
Use text rng(100) x = rand(10,1); % some data plot(x) text(1,.1,"Sum = " + string(sum(x))) Modify as needed

3 years ago | 0

| accepted

Load more