Answered
How do I get time-domain data for Control System Internal AnalysisPoints
Likely the best you can do with lsim are to get the state trajectories. See Get state update for simulation of discrete state s...

4 years ago | 0

Answered
Decimail Years date to JulianDate
Try this — format long g T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/908805/exp.txt', 'Var...

4 years ago | 1

| accepted

Answered
Difference between bode and my calculation of amplitude of the frequency response
The ‘fre’ vector needs to be created in logspace and it then needs to be divided by because the frequency axis is in rad/sec. ...

4 years ago | 0

| accepted

Answered
How to index a cell array in a for loop
See if: base_obs{i} = cell2mat(textscan(fileID, '%f %f %f %f %f %f %f %f')); produces the desired result. .

4 years ago | 1

Answered
Can't write transfer function properly.
MATLAB does not recognise implicit multiplication. Be sure to include multiplication operators (*) when you code ‘G’ just aft...

4 years ago | 0

| accepted

Answered
Exponential Function Plotting From Reverse
I initially could not get the 'XDir' to 'reverse' before the loop. Apparently it is necessary to plot something and then set th...

4 years ago | 0

| accepted

Answered
draw a function composed of sin and cos
Use element-wise operations y1=100*sqrt(2*pi)/sqrt(0.05*pi).*cos(x/2).*(1.-cos(x/2.).*sin(x/2.).*sin(3.*x/2.)); ...

4 years ago | 0

| accepted

Answered
Highlighting sections of a plot
The patch function did not always work with datetime values. It does in recent releases. However it does not appear that the...

4 years ago | 1

| accepted

Answered
How to add a patch to a plot of data?
I am not certain what your function or data are or what you want to plot. See if this helps to cliarify the general approach ...

4 years ago | 0

Answered
How to fine a range of values before and after a specific value with a condition
Try this — GetRange = @(range,Val,T,Col) strfind(T{:,Col}', [zeros(1,range) Val zeros(1,range)]); Col2 = zeros(24,1); Col2(r...

4 years ago | 0

| accepted

Answered
add vertical lines using xline
It would helpo to understand what the dates are in the posted code. figure xline(datetime('20/01 7:00am', 'InputFormat','dd/...

4 years ago | 0

| accepted

Answered
Get state update for simulation of discrete state space system using lsim().
One problem is that the code ‘mixes apples and oranges’. The tf2ss function is a Signal Processing Toolbox function, as is butt...

4 years ago | 0

| accepted

Answered
Best matlab package for time series modelling
The arima function exists in the Econometrics Toolbox. (I do not have it and so I have no experience with it.) Perhaps that wo...

4 years ago | 0

| accepted

Answered
Extracting individual breathing cycles from a signal and plotting the mean cycle
If the peaks define the cycle, then finding the ‘valleys’ between them will define the beginning and end points of each cycle. ...

4 years ago | 1

Answered
state-space controlability
The example in the documentation section on Check System Controllability is the same test I usually use. It would be appropriat...

4 years ago | 0

| accepted

Answered
Function for fourier series
Try this — %%plot part M=0; A=1; T=10; t=0:0.1:60; N=10; figure subplot(4,1,1) ft=signal("square",t,A,M,T,N); ...

4 years ago | 1

| accepted

Answered
Fitting of two differential equations simultaneously using lsqcurvefit
If the differential equations are coded correctly, the curves should fit. Check that to be certain that both do, and that they ...

4 years ago | 0

| accepted

Answered
what is the relation between π*radian/sample and Hz in frequency axis of wvtool for windowing?
The radians/sample notation is the normalised frequency. The highest frequency that can be uniquely represented in a sampled si...

4 years ago | 0

Answered
How do I assign the values in my vector to their respective variables in the equation?
Taking a wild guess, perhaps something olike this (assuming that ‘a’ is the first matrix column, etc.) — Mabc = [6.9038, 1163....

4 years ago | 0

Answered
How do I remove duplicate columns in a cell array of numbers?
Working on this for a while, I took a somewhat different approach (after several failed attempts) — x = {1,0.808920599985868,1...

4 years ago | 0

| accepted

Answered
How to denormalize the output
Assuming that the normalisation was by z-score, if the mean and standard deviation of the original data were calculated and save...

4 years ago | 1

| accepted

Answered
How do I get valuables from audioinfo
The audioinfo function returns a structure, so refer to its fields — load handel.mat filename = 'C:\Temp\handel.wav'; audiow...

4 years ago | 1

Answered
Filter Sound from Data
That appears to me to be correct. If you are using the same filter for all the data sets, return the digital filter object a...

4 years ago | 0

Answered
how to plot data of the same date at one plot at a time
One approach — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/902795/table.txt', 'VariableNami...

4 years ago | 0

Answered
How to plot peaks on desired location in a 3D plot?
[X,Y] = ndgrid(0:300); C = 50:100:300; Zf = @(C) exp(-(((X-C).^2)*0.5+((Y-C).^2))); Z = Zf(C(1)) + Zf(C(2)) + Zf(C(3)); ...

4 years ago | 1

| accepted

Answered
How to keep more digits when use symbolic expressions
From the documentation on 'FloatingPointOutput' — The true value option displays symbolic results in the short fixed-decimal f...

4 years ago | 0

| accepted

Answered
Why is my plot() not working?
Experiment by commenting-out the axis call. The values being plotted are outside the axes limits. initial_l = 20; change_...

4 years ago | 0

Answered
Combine date and duration into single datetime column
Add them — DT = datetime(repmat([2018 01 01], 5, 1)) DU = duration('00:00:00') + 5*minutes(0:4)' Combined = DT + DU .

4 years ago | 0

| accepted

Answered
error regarding syms symbolic mathtool
Yes, there is. The expression is missing a multiplication operator — Rid*(R1+Rf) ↑ ← HERE MATLAB does not recognise i...

4 years ago | 0

Answered
Error using Plot for Fourier Series
I beleive there is a typographical error in the ‘x’ assignment. I changed the ‘x’ to ‘t’ on the RHS and it works. Also, the su...

4 years ago | 0

| accepted

Load more