Community Profile

photo

John Petersen


Autonomous Solutions, Inc.

165 total contributions since 2011

Control systems engineer with PhD in EE at Autonomous Solutions and I love to ski and run trails.
Professional Interests: Control systems, Localization/Navigation, Estimation, Electronic Design, Sensor Fusion

Contact

Contributions in
View by

Answered
how do I print a txt file of integers and floats?
Thank you for your input and suggestions! I have finally come up with this Ad = double(A); % cast the int to a double d...

2 months ago | 0

Question


how do I print a txt file of integers and floats?
I have tried in vain to write a text file of a mix of ints and floats. Suppose I have A = nx1 ints, and B = nx1 floats I want ...

2 months ago | 4 Answers | 0

4

answers

Question


How do I rename fields of a structure array?
Say I have a structure array such as A = 1x49 struct array with fields: a b c d H...

9 months ago | 4 Answers | 0

4

answers

Question


How do I assign the same value to every field, including nested fields of a structure?
Say I have a structure which has an unknown number of fields and each field may or may not have subfields. I want to assign a ce...

9 months ago | 1 Answers | 0

1

answer

Question


How do I run a script from a GUI that will run in the 'base' workspace?
I have a simulink model that uses a lot of variables from the base workspace. Now I am making a GUI that runs the model, but I w...

9 months ago | 1 Answers | 0

1

answer

Question


Structured Cell array assignment question
If I have something like A(1).a = {c}; A(2).a = {d}; and B(1).a = {e}; B(2).a = {f}; and want to assign ...

10 months ago | 2 Answers | 0

2

answers

Question


xlsread doesn't recognize file has changed
I have a .xlsx file that I read with xlsread. However, if I change the file and call it with xlsread again, it returns the old v...

11 months ago | 0 Answers | 0

0

answers

Question


How do I make assignments to my workspace using variable names and values in a spreadsheet?
I have an excel file that has names of structures in the top row, names of fields of those structures in the 2nd row and in the ...

11 months ago | 2 Answers | 0

2

answers

Answered
Simulink model does not "continue" after a "pause" by using set_param commands.
Your sim stops because of the pause. When you press play, it continues for one cycle and then is told to pause again in your ass...

12 months ago | 0

Question


Fill a listbox with the text of a set of enumerations
I have a listbox in a GUI that I want to populate using enumerations. My class of enumerations might be something like mye...

12 months ago | 1 Answers | 0

1

answer

Answered
Problem saving cell to txt file
The error is telling you that you can't use cells in your print function. That's because cell arrays can be different lengths, a...

1 year ago | 0

| accepted

Answered
How to use LQR and code generation?
The 'work around' is to write your own Ricatti Eq Solver.

1 year ago | 0

Question


Turn a cellarray into a single array.
I have a cell array, sig, with varying lengths of data in each cell. For example (on a simplified scale) sig = [{1}; {[2 ...

1 year ago | 2 Answers | 0

2

answers

Answered
How to convert step varying signal into linear signal(gradual rise and fall)>
One way to do it is to sample the step varying signal at each step and then use the result or you could fit a spline or polynomi...

2 years ago | 0

Answered
Function for Script. I need to write a Function that selects the positive and negative numbers from a matrix. How to write this?
a = 0.5 - rand(3,3); %Positive numbers a(a>=0) % negative numbers a(a>0)

2 years ago | 0

Answered
Substituting a number for NaN in anonymous function
You have .*f(x) in g(x), which is still giving you a NaN

2 years ago | 1

Answered
Solving steady state Kalman riccati equation
Just write out the equations. If it's 2x2 it shouldn't be too hard. Q and R are almost always diagonal. P is symmetric, so thes...

2 years ago | 0

Answered
Extended Kalman Filter converges to wrong values (super simple model)
You have a constant dt used in the filter, but the simulation is variable step. This will cause problems with your predictor. ...

2 years ago | 0

| accepted

Answered
Quadcopter PID Controller Implementation - Derivative Filter
Apply your derivative gain to the angle rate error and the proportional gain to the angle error. Angle rate error would be (des...

2 years ago | 0

Answered
Can't see variables in workspace when run from a function
I see where you are calling the other functions, but you are ignoring the return variables. Is that the problem? What specific...

2 years ago | 0

Answered
"Hold on" function doesn't work when use set function to dynamically plot data
Try set(hp1, 'XData', [get(hp1, 'Xdata'); k], 'YData', [get(hp1,'Ydata'); c1(k,1)]);

2 years ago | 1

Answered
Filtering of data in simulink
A simple low pass filter (for scalar inputs - easily modified for vectors) is y(i) = (alpha)* y(i-1) + (1-alpha)*x(i); ...

2 years ago | 0

Question


Indexing multiple values of an array of structures with a field that varies in length
I have an array of structures, A. Each structure has a field 'vec'. Each 'vec' is a vector, but the length of the vector can v...

2 years ago | 1 Answers | 0

1

answer

Answered
How to design LQG controller for optimal trajectory
y is obviously of dimension 3. Which element of y do you want to see? Just pick it out with a demux or bus selector.

2 years ago | 0

Answered
Process Noise “Q” covarience matrix in a kalman filter
The measurement error is not used to update any covariance matrices in a Kalman filter.

2 years ago | 0

Answered
Kalman Filter block that allows computing state transition matrix each time?
Why don't you write your own Kalman filter in an Mfile and simulation time as an input. You can determine the elapsed time in th...

2 years ago | 0

Answered
Kalman Filter acceleration Integration
Accelerometers are notoriously noisy and also drift with temperature and age. The error in your estimate of position will grow o...

2 years ago | 0

| accepted

Answered
Kalman FIlter to obtain pitch angle
You could use accelerometer data to measure pitch. Or you could estimate q and q bias with a Kalman filter, but then you still ...

2 years ago | 0

Answered
Finding out Q and R matrices of a given system.
R and Q are the plant and sensor uncertainty covariance. I can't tell from your code which is which. You can start with an initi...

2 years ago | 0

Answered
How do you apply Kalman filter to a non-linear system
Use Extended Kalman filter. For predict equations, leave it non-linear. Use linearized equations for calculating K and updating ...

2 years ago | 0

Load more