Answered
How to calculate peak value and duration of signal in Image
The indexing in the image makes this a challenge, since they reflect back and in any event are non-monotonic, eliminating a stra...

4 years ago | 0

Answered
Unable to resolve the name 'fdesign.lowpass'
Run these commands from a script or the Command Window: restoredefaultpath rehash toolboxcache then try it again. If yo...

4 years ago | 1

| accepted

Answered
For-loop using only last iteration
It is necessary to index into ‘C’, however I do not know what you want as the result. % clearvars; C = zeros(1,10); %Create ...

4 years ago | 0

| accepted

Answered
Piecewise Function Surface Plot
They are not seamless because the first surface ends with Z=1 and the second begins with Z=2. Change the constant in the second...

4 years ago | 0

Answered
Add Bar over Letter x for mean value symbol
Use '$\bar{x}$' to get: .

4 years ago | 1

Answered
I would like to know how can I plot amplitude and phase
I tweaked your code slightly. Try this — t=1:0.07:20; x=sin(t)+sin(t).*cos(t); Fs = 1/0.07; ...

4 years ago | 0

| accepted

Answered
How to extrapolate an x value from a fitting curve?
You can eliminate the monotonicity problem by first selecting the region of the desired value — xvalues = [10; 12; 22; 28]; y...

4 years ago | 0

Answered
Matlab matrix syntax weird
It is likely easiest to assign a value to ‘height’ and ‘width’ and see the result — height = 4; ...

4 years ago | 0

Answered
Add new "datetime" elements to an existing cell array (matrix)
I am not certain what a more universal end result would look liks, however this seems to work for this problem — a = cell(3,3)...

4 years ago | 1

| accepted

Answered
Finding value of x given y in a model fit to normcdf
Perhaps something like this — yValues = [0.3333 0.5000 0.8333 1.0000 1.0000 0.8571]; xValues = [1.4000 1.80...

4 years ago | 0

Answered
How to fix error about interp1?
It would be helpful to have ‘wtemp’ and ‘wdepth’ to experiment with, as well as a description of what you want to do. It may ...

4 years ago | 0

Answered
EMG signal to segmnent
Use the buffer function for part of this — EMG = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/11...

4 years ago | 1

| accepted

Answered
How do I pass a function a mathematical function of the for x.^2
If ‘Function’ is a string and contains only the variable ‘x’ — Function = "x^2" [y,x] = calculatethefunction(Function); ...

4 years ago | 0

| accepted

Answered
Wrong area filled with fitlm confidence interval
Use the patch function for best results — x_data = linspace(-7, 5, 25).'; y_data = randn(size(x_data)); mdl = fitlm(x_data...

4 years ago | 1

| accepted

Answered
Solving ODE in MATLAB with pre-defined steps
‘How can I specify that I do not want random values of t in the ODE? Here, I want t to range between 0 and 2.75 but I want a ste...

4 years ago | 1

Answered
How to Plot Numbers on top of Bar graphs?
Try this — components = {'First Design', 'Second Design', 'Third Design'}; x = [66.5 33.5; 68.7 31.3; 64.9 35.1]; figure ...

4 years ago | 0

| accepted

Answered
population variance (Equivalent of var.p command in excel in Matlab)
Try something like this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1165263/ffm.csv', 'Va...

4 years ago | 1

| accepted

Answered
How to plot the 3D exponential delay profile and Jake Doppler profile
It appears to be a surf function plot. It requires either three matrices, or two vectors and a matrix.

4 years ago | 0

Answered
How to flip the top x-axis so it matches the bottom plot?
I am not certain what you want. One option — ax_top.XAxis.TickLabels = 1./(ax_top.XAxis.TickValues); % <— ADDED...

4 years ago | 0

Answered
How to integrate cosine wave in MATLAB?
One way to ingegrate the ‘V1’ vector is to use cumtrapz — f=50; a=1000; dt=0:1e-6:40e-3; V1=a*cos(2*pi*f*dt); figure pl...

4 years ago | 0

| accepted

Answered
Bode different phase issue
In the freqs call, the phase is wrapped. Unwrap it and freqs matches bode — wp = 1; ws = 1.2; Rp = 0.2; Rs = 25; [n, Wn] ...

4 years ago | 0

Answered
How do I get just the x and y axis to show up?
Perhaps — axes See the documentation on axes for details. .

4 years ago | 0

Answered
Error between two non linear functions
The goodnessOfFit function is for System Identification Toolbox estimated systems. If you are estimating a nonlilnear model, ...

4 years ago | 0

| accepted

Answered
how find optimal threshold?
I am not certain what you are asking. The ‘threshold’ as illustrated would be the mean (or median) of the selected normal dis...

4 years ago | 0

| accepted

Answered
State-space system identification using known states, inputs, outputs
I generally use lsim rather than sim. Looking through the sim documentation for opt, the simOptions function has a way to speci...

4 years ago | 0

Answered
ss dont work properly
The ‘A’ and ‘B’ matrices contain symbolic variables. Use the subs function to assign numeric values to them, and then the dou...

4 years ago | 0

Answered
Add trend line to scatter plot with years in the X-axis
I am not certain what the data are. Assuming originally a datetime array and a double vector, try something lilke this — Da...

4 years ago | 0

| accepted

Answered
Calculate area of inside polygon using inpolygon
There are Mapping Toolbox functions areaint and similar functions to do this. Those might be more appropriate. Follow the link...

4 years ago | 1

| accepted

Answered
Methods for smoothing contour lines
I dislike going to external sites. Increasing ‘N’ would be the option I would use, initially experimenting with 250 and perha...

4 years ago | 1

| accepted

Answered
histogram of datetimes with customisable bin width
After doing a few conversions between datetime and duration to get all the arguments to be what the functions want — % input ...

4 years ago | 1

| accepted

Load more