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

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

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

### 3

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

### 3

Question

Solve equation that has a complex subexpression
I want to solve the following equation for omega: where So I tried this: syms s omega G(s) G(s) = 10/(s*(1+s)*(1+0.2*s))...

presque 2 ans ago | 2 answers | 0

### 2

Question

How to assign values to an array with broadcasting
Is there any way to do broadcasting while assigning values to an array? I know how to broadcast a computation: G = zeros(3) G...

presque 2 ans ago | 1 answer | 0

### 1

Undefined function 'workspacefunc' — How to change search path back after accidentally changing it
In the end I simply force-quitted MATLAB and restarted it and it works as normal again. (Remember to save your work first).

presque 2 ans ago | 0

| accepted

Question

Undefined function 'workspacefunc' — How to change search path back after accidentally changing it
I couldn't remember the function to check if a directory exists so I typed the following, and then accepted the suggested correc...

presque 2 ans ago | 2 answers | 0

### 2

Question

How can I determine the order of a symbolic differential equation?
I'm writing a function that takes a differential equation in symbolic form as an argument and I want to determine the order of t...

presque 2 ans ago | 1 answer | 0

### 1

This is far too complicated and there are too many potential solutions. I have this error after installing MATLAB on a second c...

presque 2 ans ago | 1

Can't see any effect of NoiseVariance with idpoly and lsim
Maybe lsim is not the right function to use. I solved the problem by using sim instead, which has options including to add nois...

presque 2 ans ago | 0

Question

Can't see any effect of NoiseVariance with idpoly and lsim
I'm trying to simulate this system with an output disturbance. With or without NoiseVariance specified I cannot see any differe...

presque 2 ans ago | 1 answer | 0

### 1

Question

How to get number of factors after factorizing a symbolic function?
I'm using factor to factorize a symbolic polynomial. Works well but when the result is a symbolic vector containing the factors...

presque 2 ans ago | 1 answer | 0

### 1

Question

Using factor on symbolic expression but not always factorizing
I'm trying to show both versions of a symbolic equation, one unfactorized and one factorized. This example works as expected:...

presque 2 ans ago | 1 answer | 0

### 1

Find the transfer function of a differential equation symbolically
@madhan ravi was right. Using the simplify command works in this case: rhs(eqn_s0) / U(s) / (simplify(lhs(eqn_s0)) / Y(s)) ...

environ 2 ans ago | 0

| accepted

Find the transfer function of a differential equation symbolically
Maybe the problem is something to do with simplifying the left hand side when Y(s) is a function. If you substitute Y(s) for a ...

environ 2 ans ago | 0

Question

Find the transfer function of a differential equation symbolically
As an exercise, I wanted to verify the transfer function for the general solution of a second-order dynamic system with an input...

environ 2 ans ago | 2 answers | 0

### 2

How to make a symmetric matrix with symbolic elements
This seems to work: >> Q = tril(Q.') + triu(Q,1) % Uses top half of Q to make Q symmetric Q = [ q1_1, q1_2, q1_3] [...

environ 2 ans ago | 0

Question

How to make a symmetric matrix with symbolic elements
There's already a similar question for how to make a symmetric matrix with certain values. But I want to create a symbolic ma...

environ 2 ans ago | 1 answer | 0

### 1

Is there any concept like dictionary or hash talbes in matlab like in Python?
struct seems to produce a much nicer text output than container.Map: % Example with struct settings = struct(); settings.open...

environ 2 ans ago | 0

Question

Band Error in idinput - Unrecognized function or variable 'u'.
I was playing around with the Band argument for idinput and got this error. >> Range = [-1,1]; >> Band = [0 2]; >> u_signal =...

environ 2 ans ago | 1 answer | 0

### 1

Question

Is it possible to have a table with a numerical index instead of strings?
I'm new to MATLAB and wanted to make a table containing time-series data where the index (time) is a series of integers. I trie...

plus de 2 ans ago | 3 answers | 0

### 3

Question

How to step through a discrete model simulation one step at a time
I have a discrete-time ARX model that I want to use to represent the plant in a simulation: Ts = 1; sigma = 0.01; d = 3; sys...

plus de 2 ans ago | 1 answer | 0

### 1

how to generate square wave in matlab
Based on Rashmil Dahanayake's idea I made a simple function to generate regular square waves for discrete time. function sq = s...

plus de 2 ans ago | 1

How to make a list of iddata objects
Here is a solution. Use the index to assign to the cell array: % Loop through files for k = 1 : length(theFiles) file = ...

plus de 2 ans ago | 0

| accepted

Question

How to make a list of iddata objects
I'm loading data from a bunch of csv files and making each one into a iddata object. How do I create a collection from the resu...

plus de 2 ans ago | 1 answer | 0

### 1

Question

Creating iddata from data in tables
I guess iddata won't accept data from a table. >> dataTable(1:5,:) ans = 5×5 table Time H1 H2 T1 ...

plus de 2 ans ago | 1 answer | 0