Answered
Signal amplitude decreases after FIR filter(windowing method)
I have no idea what the sampling frequency is, so I assume 10 GHz here, with a cutoff of 1.5 GHz. When I simulate it with the f...

4 years ago | 1

Answered
What is wrong with my Code? (Fast Fourier Transform)
The ‘rect’ funciton does not exist in MATLAB, so I use rectpuls here instead — %A1.2 T = 0.002; t = -0.01 : 0.0002 : 0.01; ...

4 years ago | 1

| accepted

Answered
why sos doesn't have overshoot
The transfer function representation is unstable. The second-order-section representation creates a stable filter. That is evi...

4 years ago | 0

| accepted

Answered
Combining two datetime columns into one
Another option is to use timeofday — Date = repmat(datetime('now','Format','MM/dd/yyyy'), 3, 1); Time = datetime('now','Forma...

4 years ago | 0

| accepted

Answered
Matlab returns answer with another variable z. What does this mean?
Put the syms declaration first and use vpasolve — syms gamma Usb A2a U2a U2b R = 8; gamma = 1.4; U2b = 1000; U2a = 800; T...

4 years ago | 0

Answered
Change detection (step) in timeseries signal
You can likely get close to that point using islocalmax and particularly Flat Maxima Regions. It might be necessary to use smoo...

4 years ago | 0

| accepted

Answered
Extract the last day of each month in daily data set
One approach — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/918889/VIX.csv', 'VariableNaming...

4 years ago | 0

| accepted

Answered
Same colour scale for scatter and line plots on same graph - different groups of data
For 1. this is easy enough Use plot instead of scatter — powerpc=[70 58 42 28]; figure %subplot(4,2,8); plot...

4 years ago | 0

| accepted

Answered
Help regarding plotting of graphs
With those ranges and magnitudes, the logspace funciton would be the better option — t = logspace(1, 99, 1000); y = exp(-1E-4...

4 years ago | 0

| accepted

Answered
looking for values for all days but only for a certain time range
Use ‘logical indexing’ (the ‘Nighttime’ vector here) to choose the time range — Timestamps = datetime('07-Mar-2022 10:44:37','...

4 years ago | 0

| accepted

Answered
How to insert an image into an image in matlab ?
The Position Multiple Axes in Figure documentation section in axes could work here — Ic = imread('cameraman.tif'); Ip = imre...

4 years ago | 1

Answered
I am not understanding why my code is giving me a not enough input error.
I’m not certain how you called the function. This lacks the file, although it otherwise appears to work — peak_hour = 12; ...

4 years ago | 0

Answered
Accidentally edited .m file
If you did not close MATLAB after the unfortunate edit, it might be possible to reverse the edits by using the ‘undo' arrow (cou...

4 years ago | 0

| accepted

Answered
new column with running average of existing column
Try this — T1 = table(randn(20,1)) T1.Var2 = movmean(T1.Var1,[10 10]) See the documentation on movmean for details. .

4 years ago | 0

| accepted

Answered
How to fprintf a 1 column matrix of random length
Try this — v = [10.5000 18.0000 16.5000 21.0000]; L = 1:numel(v); fprintf('Row %3d is %g\n',[L(:) v].') ...

4 years ago | 1

| accepted

Answered
Interpolation not-equally spacing data
I generally use griddata for these sorts of problems. I cannot determine if it will produce the desired result since I don’t ...

4 years ago | 0

Answered
Converting dates in time series
One approach — M = {'27-Feb-2007 12:00:00' 58.199 -136.64 -0.0048352 ...

4 years ago | 0

Answered
Error when creating an empty Table
To preallocate a table see the documentation section on Specify Size and Variable Types since an empty table nevertheless has sp...

4 years ago | 0

| accepted

Answered
How can I split measured data in separate vectors, depending on sign value?
One approach — v= [1 2 3 4 5 4 3 2 1 2 3 4 5 4 3 2 1]; dv = gradient(v); sel = v(dv>=0); dsel = diff([1 find(diff([sel(1) s...

4 years ago | 0

| accepted

Answered
how to plot sequare wave ?
See if the pulstran function will do what you want.

4 years ago | 0

Answered
Fourier transform of a function
The only problem I see is in the ‘Fv’ calculation. It should be: Fv = linspace(0, 1, (nfft/2)+1)*Fn; % Frequenc...

4 years ago | 0

| accepted

Answered
Create a specific matrix (MATLAB)
Try this — M = hankel(1:4,4:-1:1) .

4 years ago | 1

| accepted

Answered
How to plot the normalized frequency spectrum of a half-wave rectified signal
Try this — T = 4; t = linspace(0,10,200); w = 2*pi/T; x = sin(w*t); x(x<0) = 0; plot(t,x); title("Señal rectificada ...

4 years ago | 0

| accepted

Answered
How to perform summation with double subscript notation?
First, provide the ‘C’ and the other missing vectors, then save ‘alpha’ as a matrix, then use the sum function to sum its elemen...

4 years ago | 0

| accepted

Answered
Unable to find symbolic solution warning
The plot shows nothing because the initial conditions are zero, and since the variables appear in both the numerator and denomin...

4 years ago | 1

Answered
How to generate a curve describing a contour on 3D scatter plot
I’m not certain what you want to do, however it is possible (although not straightforward) to extract the various contours using...

4 years ago | 0

Answered
pid controller (m-file ) with input data and output data
See if the lsim function will do what you want.

4 years ago | 0

| accepted

Answered
Categorizing groups of data
See if the findgroups function will do what you want. EDIT — (5 Mar 2022 at 17:36) Uz = unzip('https://www.mathworks.com/...

4 years ago | 0

| accepted

Answered
Decimation/Interpolation - Anti-Aliasing and Anti-imaging Filter Design in MATLAB
All this is already implemented in the resample function. Have you experimented with it, or do you simply want to reproduce i...

4 years ago | 0

Answered
Trying to change the amount of decimal points
Probably the easiest is to use the round function: weightArray=[68.6611,8.7929,71.6766,44.1901,76.2861,66.1515,22.6083,36.9491...

4 years ago | 0

Load more