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

plus de 3 ans il y a | 1 réponse | 0

0

réponse

Réponse apportée
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^...

plus de 3 ans il y a | 0

Réponse apportée
eigenvalue diagonalization in matlab
Does eig not provide the solution, assuming a solution exists?

plus de 3 ans il y a | 0

Réponse apportée
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); %...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

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

plus de 3 ans il y a | 1 réponse | 2

0

réponse

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Graphing Fourier magnitude and phase spectra using fft, error: Array indices must be positive integers or logical values.
Hi Luke, At the line in question, we see that x(t) is non-integer numeric value, which can't be used to index into the array ff...

plus de 3 ans il y a | 0

Réponse apportée
matrix math problems , error in matrix size
Hard to say without without knowing anything about the data in the question. Based on the wording it should work as follows A =...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Creating a Closed loop transfer function of a model
Hi Jacob, Perhaps a clue is that the code doesn't use loop1 after it's computed. Once you have loop1, how does it relate to G2 ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How to solve a non-linear system of differential equations?
Hi Pacao, The missing step is a call to odeToVectorField before the call to matlabFunction. Check that first doc page and then ...

plus de 3 ans il y a | 0

Réponse apportée
Systems with two different execution rates
Hi Samy, Are you intending to have one model reference the other via a Model block? If so, and if you have at least R2022a, I ...

plus de 3 ans il y a | 1

Réponse apportée
Calling the vectorized Matlab fcn from within Simulink
Use a Matlab Function block in the Simulink model and call your function from inside that block. If your function is not amenabl...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Generating numbers following a lognormal distribution within a specific interval
Hi Behrooz, Shouldn't the relationship be the log of the mean of samples is equal to mu + sigma^2/2 ? In any case, why would t...

plus de 3 ans il y a | 0

Réponse apportée
Inconsistency of the figure and value on the curve
Hi @M The equation for Dcdenominator is not properly vectorized. In one spot it uses /, which should be ./ % was % Dcdenom...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Problem using symbolic sinc?
We can get rid of the vertical asymptote with: syms x y w F A = 1; tau = 1; F = A*tau*sinc(w/(2*pi)*tau); figure fplot(abs...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Mixture of 2 salts + Dirac
Hi Adrielli, Why is Ain defined and then redefined? Is that correct? What is the role of the x and y variables in this problem...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How to create a transfer function with no simplification ?
I'm almost certain that this can't be done in the CST. If just wanted for display purposes you'd have to write your own code, bu...

plus de 3 ans il y a | 1

Réponse apportée
Discrete input signal and continuous transfer function
Not sure what the issue was with lsim without seeing the code. Is the transfer function contiuous time, e.g. a model of an anal...

plus de 3 ans il y a | 0

Réponse apportée
how to replace a symbolic variable with a real one after computation?
Use subs or symfun objects and covert to double are two options syms I3 I4 d = I3 + I4; double(subs(d,[I3 I4],[1.1 2.2])) d(...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
sinc function doesnt work...
The code runs fine here. clear all close all clc T=0.1; A=1; tau=T/2; kmax=20; t0=tau/2; %% f0=1/T; t=(0:0.0001:1)*5*...

plus de 3 ans il y a | 0

Réponse apportée
Find source of stopped simulation in Simulink
Hi Stefan, If you use the sim command, then the output has some useful information. For example, I used a model with a Clock, f...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Bode Plot options to graph
Can be done if using bodeplot instead of bode H = tf([1 0.1 7.5],[1 0.12 9 0 0]); h = bodeplot(H); setoptions(h,'MagUnits','a...

plus de 3 ans il y a | 0

Réponse apportée
How to skip many vectors in a legend?
Something like this, but with different data simulation = rand(100,20); average = mean(simulation,2); analytical = 0*average+...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
3D plot of sum series, error in symsum fuction
Hi grisham, The function symsum can only be used with symbolic inputs, as created by syms for example. However, the code has no...

plus de 3 ans il y a | 0

Réponse apportée
How to you put sin function in Simulink
Feed the output of a Clock into a Gain of 1/2. Feed the touput of that gain into a Trigonmetric Function block, select the cos o...

plus de 3 ans il y a | 0

| A accepté

Charger plus