Answered
What frequency range does fft compute?
The first element of the output of the fft function is the constant or DC offsets (mean values) of the original time domain vect...

4 years ago | 0

| accepted

Answered
Multiply only certain columns in a matrix with a constant
Another approach — M = rand(5,9) % Shorter Version Of 'M' c = 1000; ...

4 years ago | 0

| accepted

Answered
Index exceeds the number of array elements. Index must not exceed 0.
A variable with zero elements is empty. The error could be referring to the empty first argument in the function call.

4 years ago | 0

Answered
Bode diagram for a Butterworth filter
Use the freqz function — Fs = 60; % Sampling Frequency Fn = Fs/2; ...

4 years ago | 0

Answered
Plot ODE45 data in a surface
One option for creating a surface from two vectors is to multiply the transpose of one with the other so that the first vector i...

4 years ago | 0

Answered
Not really understanding why cdata isn't working
The ‘cdata’ matrix only exists if you create it. See the heatmap documentation section Create Heatmap from Matrix Data for de...

4 years ago | 0

Answered
Select zone of the plot
This can certainly be done, however it is definitely not trivial! Try this — LD = load('Miguel Albuquerque azimuth3.mat'); ...

4 years ago | 0

| accepted

Answered
What is Symbolic Math Toolbox and how to get it
For a description, see Symbolic Math Toolbox. Getting it depends on what type of license you have (university, individual, et...

4 years ago | 1

Answered
Plot electric field in plane
Try this — M1 = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1077575/data.txt') [U1,ix1] = uniq...

4 years ago | 0

| accepted

Answered
Filter data through a bandpass FIR
That’s a problem with FIR filters, simply because in most instances they tend to be very long vectors. Use an IIR filter inst...

4 years ago | 0

Answered
How to find inverse of filter such that product of filter and its inverse results in a flat spectrum
The easiest way to find out is to do the experiment — Fs = 1E+5; t = linspace(0, 1E+5, 1E+6)/Fs; fc = [1 2 4]*1E+4; s = sum...

4 years ago | 0

Answered
MATLAB fixing dates that are flipped
The first variable is imported as a cell character array, so it has to be changed to a datetime array for the rest of this to wo...

4 years ago | 0

| accepted

Answered
Shading Between Two Lines
It would be easier with your data. Assuming that all the vectors are coiumn vectors — HH = linspace(4, 20).'; LWAC = 10*(1...

4 years ago | 1

Answered
How to extract wandering baseline
There are several options, however the one I usually use is first to calculate the Fourier transform of the signal using the fft...

4 years ago | 0

Answered
How to set up Paris Law Integral
Since ‘K’ is a funciton of ‘x’ it needs to be created as an anonymous function, and for whatever reason, the integrand ‘fun’ cre...

4 years ago | 1

| accepted

Answered
How to extract corresponding x axis value in improfile.
Try this (using an example from the improfile documentation) — I = imread('liftingbody.png'); x = [19 427 416 77]; y = [9...

4 years ago | 1

| accepted

Answered
From a matrix creating a vector
Use the unique and accumarray or histcounts functions. This appears to be homework, so I leave the coding to you.

4 years ago | 0

| accepted

Answered
Count the number of "aggregate" peaks in a vector?
I am not certain what result you want. Here, findpeaks finds 21 distinct spikes (and their locations) LD = load('buzzerData...

4 years ago | 1

| accepted

Answered
How to add a dashed line for values greater than a set threshold in contourf plot?
One option is to use hold and plot the threshold with a separate contour call — [X,Y,Z] = peaks; figure contourf(X,Y,Z, 'S...

4 years ago | 0

| accepted

Answered
How to set the grid line of y-axis by 5 ?
If you have R2018b or later, the easiest solution would likely be the xline and yline functions. x = 0:5; y = randi(40, size...

4 years ago | 0

Answered
Consildation of two program
I would duplicate them as function files with the appropriate input arguments and outputs, and then call them from a specifc scr...

4 years ago | 0

Answered
How to introduce a time-shift into data?
I cannot run the code (missing data), however the conversion from milliseconds (in this instance) to samples is straightforward ...

4 years ago | 0

| accepted

Answered
Plot deviation of curve as shaded area inside
I generally prefer patch to fill — x = transpose(1:100); y = x.^2; curve1 = y*1.05; curve2 = y*0.95; x2 = [x flipud(x)];...

4 years ago | 0

| accepted

Answered
exp doesn't return the expected values
That is esactly what it is doing — format longG x = [1 2 3; 4 5 6; 7 8 9]; y = exp(x) y11 = exp(1) y33 = exp(9) What ...

4 years ago | 0

| accepted

Answered
44.1 kHz Sample Rate
‘Could anyone please explain this phenomena regarding sinusoidal waves and filtering?’ Digital filters are designed to work w...

4 years ago | 1

Answered
How to add a value of a point on y axis in a PLOT ?
Possibly — point = [4, 2.5]; figure plot(point(1), point(2), 'or', 'MarkerFaceColor','r') axis([0 5 0 5]) hold on plot...

4 years ago | 0

Answered
How can i plot 3d scatter and equation plot in single figure?
UIse the hold function to plot them on the same axes — P=[4500 4550 5000 9050 14300 6000 7000 3000 13600 7500 4000 6400 8500 8...

4 years ago | 0

| accepted

Answered
Using System Identification Toolbox More Effectively
‘Because when we use low pass there will be a little phase shift and it can effect the transfer function of the system.’ You ...

4 years ago | 2

| accepted

Answered
Problem with solving a system of differential equations using ode45
I have no idea what the iniitial conditions are suposed to be. The oscillation might be the result of the if block defining ‘...

4 years ago | 2

| accepted

Answered
Presenting signal in different forms
The data do not appear to be exactly the same, so I am not certain how the values in the right plot were calculated from it. ...

4 years ago | 0

Load more