Réponse apportée
How to incorporate equations in the connect function for control design?
connect only works with lti system objects. Nonlinear elemens have to be linearized around an equilibrium point and the lineari...

presque 3 ans il y a | 1

Réponse apportée
lsim() vs step() : are different responses expected?
@John I was able to recreate your strange result on R2022a. After some investigation, I think I know what's happening. load ...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
Adding InternalDelay for State Space system
Hi John, I suspect the error message is telling you that you can only change the value of internal delays that already exist in...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
How to plot the actual frequency range for the FFT plot?
clear all; close all; clc; %% Signal parameter c = 3e8; % speed of light fc= 10e9; % c...

presque 3 ans il y a | 0

Réponse apportée
A weird feature in the obtained function from calculating the inverse Fourier transform using ifft
Hi Shaily_T, It looks like the purpose of the code is to linearly convolve an input signal with an impulse response via mulitip...

presque 3 ans il y a | 1

Réponse apportée
Omega method to integrate sin function
Hi Tommaso, Starting with the acceleration as in the orginal code (I prefer to use row vectors) % use row vectors fs = 20; % ...

presque 3 ans il y a | 2

| A accepté

Réponse apportée
How to find the correct magnitude/frequency value for FFT when there has noise?
Hi Hantao, Load the data x = readtable('Data.xlsx'); Time = x.Time; Current = x.Current; Plot it figure plot(Time,Current...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Why is FFT result divided by NFFT instead of the root of NFFT?
Hi Miktat, The energy spectrum and the amplitude spectrum are two different things. Using the conventions of fft, the output yf...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Why does cconv perform worse than conv?
I ran this code where cconv outperforms conv for large n n = round(linspace(1e3,1e5,50)); n2 = 2.^(5:nextpow2(n(end))); n = s...

presque 3 ans il y a | 1

Réponse apportée
lsim() vs step() : are different responses expected?
The code and the system in the .mat file does not recreate the step plot. There is also an undefined variable. load sys.mat % ...

presque 3 ans il y a | 0

Réponse apportée
What is being "averaged" in the matlab bandpower() function?
Hi Joey, I will confess to only having basic knowledge of this subject and suggest a thorough review of a good textbook. I'll t...

presque 3 ans il y a | 0

Réponse apportée
change class syms to double
Something like this ... e = exp(sym(1)) class(e) format long e = double(e) class(e)

presque 3 ans il y a | 0

Réponse apportée
ifft returns NaN when plotting the impulse response function
Hi 粤轩 杨, It looks like h_FFT also has a few values that are inf, in addition to the NaNs load("AIF_1.mat"); load("inj_1.mat")...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Extract first and last row of each subarray in a cell array
I think this works even if the first and last row of a cell are identical. load(websave('cellArray.mat','https://www.mathworks....

presque 3 ans il y a | 1

| A accepté

Réponse apportée
Issues with subs function
I'm sure if you go through it step-by-step, or w/o assigning numbers until the end, you'll see that value of b1 is magical and a...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
plotting a surface between two curve
Hi M, Here's some code to get started. % small curve file_address = 'https://www.mathworks.com/matlabcentral/answers/uploaded...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
convolution without conv function
Questions like this are fairly common on this forum. A closed form expression can be obtained using syms heaviside rectangula...

presque 3 ans il y a | 0

Réponse apportée
fplot and laplace transform
Based on the comment thread in the question, I think the best you can do symbolically would be some something like this: A = [-...

presque 3 ans il y a | 1

Réponse apportée
Complex equation in MATLAB (control engineering)
Hi Michael, vpasolve found a solution, even if it's not the one you want. syms s syms w T real F_O = (exp(-s*T))/(s*(1+s)); ...

presque 3 ans il y a | 0

Réponse apportée
how to model this algorithm in simulink?
In the integrator block, set the "Initial Condition Source" to external. Then, connect that source to whatever logic you need t...

presque 3 ans il y a | 0

Réponse apportée
Discretize State Space feedback controller using c2d()
Hi John, lqrd returns the gains for a discrete time controller. The Control System Toolbox cannot model hybrid systems, as far ...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
Matlab function block and integration
If computing the instantaneous power as a function of time, why not feed that into an integerator to find the energy as a functi...

presque 3 ans il y a | 1

Réponse apportée
How to create a sine function from simulink blocks?
Why not just use a Sine Wave block? Would be a lot easier, and you can specify the sample time. The plot you're getting is most...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Linearize and Transfer Function
Does linearize do what you need? It can be used to linearize a model or a specific block in a model. Not sure how well it works...

presque 3 ans il y a | 1

Réponse apportée
remove annotations from diskmarginplot
Hi Muhammad, Something like this might work, either inside or after the loop. Some experimentation may be needed. Disk margin ...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
How do I change variables so that I can differentiate with respect to a derivative?
Hi Curran, The doc page functionalDerivative has related example and shows the problem can be solved like this: % Symbols sy...

presque 3 ans il y a | 2

| A accepté

Réponse apportée
Normalizing an FFT Vector
Hi bil, Define psi syms x real L = 100; psi(x) = sqrt(sym(2)/L)*sin(sym(pi)*x/L)*rectangularPulse(0,L,x); %particle in a box...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
Close loop bode plot
If you have a model of the plant and a model of the controller, it's likely that all that's needed is the feedback command to co...

environ 3 ans il y a | 0

Réponse apportée
How does bandpower() round the input frequencies in variable 'freqrange'?
Hi Joey, bandpower is an .m file, at least in 2022a, so you can inspect the code. My reading is that it will compute the power...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Symbolic acos( cos(theta) ) does not return theta.
simplify does provide an option that returns theta: syms theta real assume( theta >-1 & theta < 1) a = simplify( acos(cos(the...

environ 3 ans il y a | 0

Charger plus