Community Profile

# Bill Tubbs

Last seen: 3 Tage vor Aktiv seit 2020

#### Statistics

Abzeichen anzeigen

#### Content Feed

Anzeigen nach

Frage

Test of whether matrix is Symmetric Positive Definite is giving wrong result when matrix is not symmetric
I'm computing a multivariate normal probability density with an estimated covariance matrix as follows: % Update the conditiona...

etwa ein Monat vor | 2 Antworten | 0

### 2

Antworten

Beantwortet
How to make an array of alternating 1 and -1?
Even easier: out = cumprod(-ones(1, 12)) out = -1 1 -1 1 -1 1 -1 1 -1 1 -1 1

etwa ein Monat vor | 0

Beantwortet
How to make an array of alternating 1 and -1?
Here's another way. A geometric series: out = (-1).^(0:11) out = 1 -1 1 -1 1 -1 1 -1 1 ...

etwa ein Monat vor | 0

Frage

Confusing description of built-in estimator noise model on MPC documentation page
I'm confused by the following text which appears on the documentation page: 'Implement Custom State Estimator Equivalent to Buil...

etwa 2 Monate vor | 0 Antworten | 0

### 0

Antworten

Frage

How to assign values to MV Targets of MPC object from cell array
I'm having a tough time trying to assign 3 values to the parameters of an mpc object. Here is my MPC object with it's current v...

2 Monate vor | 0 Antworten | 0

### 0

Antworten

Beantwortet
As usual, I figured it out a few minutes after posting this question! It actually says this in the documentation page I linked ...

2 Monate vor | 0

| akzeptiert

Frage

I've designed an MPC in MATLAB using the mpc function and successfully simulated it in Simulink using the MPC block in closed lo...

2 Monate vor | 1 Antwort | 0

### 1

Antwort

Beantwortet
Trying to understand dimensions of state estimates output of MPC block in Simulink
I figured out that you can use the following to get all the parameters of the Kalman Filter including the augmented model used b...

2 Monate vor | 0

| akzeptiert

Frage

Trying to understand dimensions of state estimates output of MPC block in Simulink
I'm running an MPC in Simulink that was defined in a matlab script using the MPC Controller block and I want to inspect the stat...

2 Monate vor | 1 Antwort | 0

### 1

Antwort

Beantwortet
How do I calculate the static Kalman gain (= steady-state Kalman gain)?
In addition to my answer above, I just discovered a special function for Kalman estimator design called dlqe in the Control Syst...

3 Monate vor | 0

Beantwortet
How do I calculate the static Kalman gain (= steady-state Kalman gain)?
For the record, I found a way to do it using the idare function (see this material online: hw5sol.pdf from S. Boyd). This is fo...

3 Monate vor | 0

Beantwortet
How to avoid duplicating code in the constructor and a reset method of a class with class inheritance.
I found one solution. If you put the reset code in a static method, you can call it from within the constructor. Not sure if th...

3 Monate vor | 0

Frage

How to avoid duplicating code in the constructor and a reset method of a class with class inheritance.

3 Monate vor | 2 Antworten | 0

### 2

Antworten

Beantwortet
Find index to rows of one matrix in another
I figured out the answer: >> [~, idx] = ismember(B, A, 'rows') idx = 1 3 2 2 In case you want to check that all row...

3 Monate vor | 0

| akzeptiert

Frage

Find index to rows of one matrix in another
Suppose I have two matrices: >> A = eye(3) A = 1 0 0 0 1 0 0 0 1 >> idx = [1 3 2 2]; >> B =...

3 Monate vor | 1 Antwort | 0

### 1

Antwort

Frage

Reset method being called twice during instantiation of a class instance with inheritance
I'm defining various classes with an inheritance hierarchy and having problems setting up each class's reset method so that it i...

5 Monate vor | 1 Antwort | 0

### 1

Antwort

Beantwortet
How to extract matches from results of a regexp match
Here is a one-line solution—it's based on the answer of Stephen23 but instead of finding the matches, it finds the first indeces...

6 Monate vor | 0

Frage

How to make an inherited immutable super class property mutable in the sub-class?
I have a class which has immutable properties and I want some sub-classes to be able to modify these properties. Obviously it r...

6 Monate vor | 1 Antwort | 0

### 1

Antwort

Frage

Strings are converted to cells during readtable
I am incrementally saving data to a csv file which includes strings: data = table("string1", "string2"); writetable(data, "dat...

6 Monate vor | 2 Antworten | 0

### 2

Antworten

Beantwortet
How do I create one legend for several subplots?
This is a good answer: Raghu S on 30 Aug 2018

6 Monate vor | 0

Frage

How to extract matches from results of a regexp match
I'm trying to find the columns of a table that match a pattern. This works: col_names = {'X_est_9', 'X_est_10', 'Y_est_9', 'Y...

6 Monate vor | 3 Antworten | 0

### 3

Antworten

Frage

Is there a built-in function to validate a class property that should be a cell array?
I'm new to classes and learning about how to define properties and validate their values. I have a class with a property A that...

6 Monate vor | 3 Antworten | 1

### 3

Antworten

Beantwortet
how to display the results from simulink in a table
I also prefer working with tables and csv files rather than mat files so I wrote a script to convert a Simulink SimulationOutput...

8 Monate vor | 0

Frage

Simulink vector index assignment / re-ordering using Selector block
I'm trying to merge two vector signals into one vector according to two sets of indices. For example: u_pos = [2 3 4]; du_p...

9 Monate vor | 1 Antwort | 0

### 1

Antwort

Beantwortet
Find in a cell array?
Just in case someone comes here looking to do this with a cell array of chars as I was, it's quite easy this way: my_cell_array...

10 Monate vor | 2

Beantwortet
How to add a parameter value to the icon of an S-function block
Based on the comments in response to Benjamin's answer, here is the complete and concise answer to the question: First create a...

10 Monate vor | 0

| akzeptiert

Frage

How to add a parameter value to the icon of an S-function block
I'm new to S-function blocks in Simulink but I've made a working S-function block and now I want to display a value on its icon....

10 Monate vor | 2 Antworten | 0

### 2

Antworten

Frage

How to store structs and cell arrays of matrices in an S-function's Dwork memory.
I implemented a sophisticated multi-model process observer in MATLAB code using struct objects for convenience. Each struct has ...

10 Monate vor | 0 Antworten | 0

### 0

Antworten

Frage

Find the minimums along 3rd dimension of an array
I have a 3d array that is constructed from two 2d arrays: a = [1 2 3; 4 5 6; 7 8 9]; b = [1 2 0; 4 0 9; 9 8 9]; c = cat(3,a,b...

etwa ein Jahr vor | 1 Antwort | 0

### 1

Antwort

Beantwortet
Set Simulink model simulation stop time from m file
You can also do it by passing it as an argument when you run the simulation from the m file: sim_out = sim(sim_model, t_stop)

etwa ein Jahr vor | 2