Question

What is the 'MeasurementFcn1Inputs' input on the Extended Kalman Filter Simulink block?

I'm trying to implement an Extended Kalman Filter Simulink block similar to the example shown for the inverted pendulum here whi...

environ un an ago | 1 answer | 0

Answered

Get a subset of columns from a timeseries object as a timeseries

Here is my answer to illustrates the timetables solution proposed by @dpb in the comments above. u = timetable(seconds(t),u1,u2...

Get a subset of columns from a timeseries object as a timeseries

Here is my answer to illustrates the timetables solution proposed by @dpb in the comments above. u = timetable(seconds(t),u1,u2...

environ un an ago | 0

Question

Get a subset of columns from a timeseries object as a timeseries

I have a timeseries containing data for 4 variables: Ts = 0.2; nT = 50; t = Ts*(0:nT-1)'; u1 = 50*idinput(nT); u2 = 50*idinp...

environ un an ago | 2 answers | 0

Question

How to insert the 'double R' symbol in LiveScript (space of real numbers)

Anyone know how to get this symbol in the LiveScript equation editor? MS Equation editor equivalent: \doubleR Latex: $\mat...

environ un an ago | 1 answer | 0

Question

Is it possible to solve multiple linear systems of equations in parallel with one matrix operation?

I'm wondering if there's a way to do the following calculations in one go (i.e. without the for loop). V = nan([na nv]); for i...

environ un an ago | 0 answers | 0

Question

How to replace elements of a cell array using a containers.Map

I have a cell array of VariableNames that Matlab created when reading a csv file. I want to change them to my own choice of nam...

plus d'un an ago | 2 answers | 0

Answered

Solve equation that has a complex subexpression

I just discovered that you can also solve this numerically with vpasolve: syms s omega G(s) assume(omega > 0) G(s) = 10/(s*(1...

Solve equation that has a complex subexpression

I just discovered that you can also solve this numerically with vpasolve: syms s omega G(s) assume(omega > 0) G(s) = 10/(s*(1...

plus d'un an ago | 0

Question

How to find the 'troughs' using peak finder in Simulink Scope

I've been using the Peak Finder Measurements tool in the Simulink scope output to find the peak of the system responses. But if...

plus d'un an ago | 1 answer | 0

Answered

How to check if two transfer functions are the same?

Based on comments from Paul above I offer these functions as a solution: function c = is_equal_tf(G1,G2) c = almost_zero_s...

How to check if two transfer functions are the same?

Based on comments from Paul above I offer these functions as a solution: function c = is_equal_tf(G1,G2) c = almost_zero_s...

plus d'un an ago | 0

Question

Basic math operations on contents of a cell array

Is there any reason why basic math operations don't work with cell arrays? Seems to me it would extremely useful and efficient ...

plus d'un an ago | 2 answers | 0

Question

Best way to resample the output of a Simulink simulation with variable time step into a signal with a fixed sample time

I have a simulation model that runs with a variable timestep: (I don't want to change this) For the purpose of system identi...

plus d'un an ago | 1 answer | 0

Question

How to turn off text interpreter when plotting timeseries objects

I am plotting timeseries objects using plot. My variable names include underscores (e.g. 'ABC_DEF') and I do not want these int...

plus d'un an ago | 2 answers | 0

Question

Evaluate function over a mesh grid (without for loops)

Is there a way to evaluate a function that takes an [x, y] vector as input over a grid of points? Here is the function I want t...

plus d'un an ago | 2 answers | 0

Answered

Why do I get the warning "MATLAB:dispatcher:InexactCaseMatch Cannot find an exact (case-sensitive) match for 'startup'" on MATLAB startup?

For me the problem started after I added a path to a module that I am using for a course. The scripts in this module are launch...

Why do I get the warning "MATLAB:dispatcher:InexactCaseMatch Cannot find an exact (case-sensitive) match for 'startup'" on MATLAB startup?

For me the problem started after I added a path to a module that I am using for a course. The scripts in this module are launch...

plus d'un an ago | 0

Answered

Why are symbolic expressions being rounded?

Mathworks technical support have diagnosed the problem. Don't know what caused it originally but the 'FloatingPointOutput' sett...

Why are symbolic expressions being rounded?

Mathworks technical support have diagnosed the problem. Don't know what caused it originally but the 'FloatingPointOutput' sett...

plus d'un an ago | 0

| accepted

Question

Why are symbolic expressions being rounded?

I'm deriving some expressions symbolically and then substituting values and computing the results and I only recently noticed th...

plus d'un an ago | 2 answers | 0

Answered

Trying to set parameter values in a Simulink model using a parameter structure

I gave up on trying to figure out the ParameterStructure method and ended up doing it this way which I assume is the standard wa...

Trying to set parameter values in a Simulink model using a parameter structure

I gave up on trying to figure out the ParameterStructure method and ended up doing it this way which I assume is the standard wa...

plus d'un an ago | 0

Question

How to get subscripts in the legend of a Nichols plot?

How do I put subscripts in a Nichols plot legend? This works fine in a normal plot: figure plot([0 1],[3 4]); hold on plot([...

plus d'un an ago | 1 answer | 0

Question

Trying to set parameter values in a Simulink model using a parameter structure

I'm following the docmentation here in an attempt to set up a Simulink model so I can apply a set of parameter values to it befo...

plus d'un an ago | 1 answer | 0

Answered

I get Error: Invalid expression. Check for missing or extra characters. when commenting out lines in a multi-line statement

Here is one solution but it's hardly very convenient and contrary to commenting-out in other languages: y = ... 1 + ... ...%2...

I get Error: Invalid expression. Check for missing or extra characters. when commenting out lines in a multi-line statement

Here is one solution but it's hardly very convenient and contrary to commenting-out in other languages: y = ... 1 + ... ...%2...

plus d'un an ago | 0

Question

I get Error: Invalid expression. Check for missing or extra characters. when commenting out lines in a multi-line statement

It seems you can't comment-out entire lines in MATLAB within a multi-line statement. Or am I doing it wrong. A few examples be...

plus d'un an ago | 2 answers | 0

Answered

How to implement an RST controller in Simulink?

After some further diagnosis, I think I have solved the problem. The default setting of the Discrete-Time Integrator block is '...

How to implement an RST controller in Simulink?

After some further diagnosis, I think I have solved the problem. The default setting of the Discrete-Time Integrator block is '...

presque 2 ans ago | 0

Question

How to implement an RST controller in Simulink?

Every time I search for help on this I am taken to the following page: RST Controller But I don't have access to the Simscape ...

presque 2 ans ago | 1 answer | 0

Answered

How to simulate a discrete linear system model with a user-specified disturbance signal?

I found the answer in the documentation: opt = simOptions('AddNoise',true,'NoiseData',e); Turns out I was looking at the wrong...

How to simulate a discrete linear system model with a user-specified disturbance signal?

I found the answer in the documentation: opt = simOptions('AddNoise',true,'NoiseData',e); Turns out I was looking at the wrong...

presque 2 ans ago | 0

| accepted

Question

How to simulate a discrete linear system model with a user-specified disturbance signal?

I'm using idpoly and sim to simulate a discrete linear system so I can compare the output with my own (hand-coded) simulation. ...

presque 2 ans ago | 1 answer | 0

Answered

Raise a scalar to a descending series of powers in an array

Here is the correct answer I think. Element-wise operation: 0.8.^(3:-1:1)

Raise a scalar to a descending series of powers in an array

Here is the correct answer I think. Element-wise operation: 0.8.^(3:-1:1)

presque 2 ans ago | 0

| accepted

Answered

Raise a scalar to a descending series of powers in an array

I found this solution: power(0.8,3:-1:1) ans = 0.5120 0.6400 0.8000 But still surprised if it can't be done ...

Raise a scalar to a descending series of powers in an array

I found this solution: power(0.8,3:-1:1) ans = 0.5120 0.6400 0.8000 But still surprised if it can't be done ...

presque 2 ans ago | 0

Question

Raise a scalar to a descending series of powers in an array

I'm trying to compute a series of powers of a scalar. This seems to work but the result is not what I expected: 0.8^1:3 ans...

presque 2 ans ago | 3 answers | 0

Answered

How to check if two transfer functions are the same?

There is an answer on Stackoverflow: However, it does not work directly in my case: isequal(tf(C1), Gc1) ans = logical...

How to check if two transfer functions are the same?

There is an answer on Stackoverflow: However, it does not work directly in my case: isequal(tf(C1), Gc1) ans = logical...

presque 2 ans ago | 0

Question

How to check if two transfer functions are the same?

I want to verify that two transfer functions are equal. For example: Kc = 0.4262; Ti=1.35; C1 = pidstd(Kc,Ti); tf(C1) s = t...

presque 2 ans ago | 3 answers | 0