Answered
A sinusoid has just been fed into a system.
Using phasors — syms omega sympref('AbbreviateOutput',false); % Optional omega = 2*pi*...

4 years ago | 0

| accepted

Answered
plot graph based on given values
Since they are histograms, I would do something like this — sn = sheetnames('https://www.mathworks.com/matlabcentral/answers/u...

4 years ago | 1

| accepted

Answered
Designing a discrete signal with cutoff frequencies
Similarly to the previous filter in Designing a specific low-pass discrete filter in MATLAB — Fs = 10; ...

4 years ago | 0

| accepted

Answered
Designing a specific low-pass discrete filter in MATLAB
Try this — Fs = 100; % Sampling Frequency (Hz) Fn = Fs/2; ...

4 years ago | 1

| accepted

Answered
am I correct in generating signals and fft?
The fft result should be normalised by dividing it by the number of elements in the vector: X1=fftshift(abs(fft(u,50)/numel(u)...

4 years ago | 1

| accepted

Answered
How can I only find centers of new blobs in image?
Try something like this — I1 = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/941229/image.jpeg'); I2...

4 years ago | 1

| accepted

Answered
How can I limit input into the command window?
I generally prefer to use the inputdlg fucntion, since it does not involve the Command Window. If MATLAB is writing to the Co...

4 years ago | 0

| accepted

Answered
i have 3 variables with varying date ranges, how do i condense the data so i have the same date range across all three variables?
There are likely several possible ways to solve this. Logical Indexing — DT = (datetime('2022-Jan-01') : days(7) : datetime...

4 years ago | 0

| accepted

Answered
Automatic detection of the maximum and halfmaximum in frequency domain
Since you apparently want the value of the peak and tha full-width-half-maximum (FWHM) distance value, use the findpeaks functio...

4 years ago | 0

Answered
How to load a matrix from a complicated txt file?
Try something like this — M = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/940659/Slice5mm.TXT')...

4 years ago | 0

Answered
how to shift datetime to account for daylight savings time
If you’ve not already explored it, the TimeZone property may be helpful. Also see Specify Time Zones since it appears that ‘A...

4 years ago | 0

| accepted

Answered
Same filters but using different methods give different results
‘I am getting different results when using the [b,a] filter method and [z,p,k] method.’ I am not surprised. Filters using tr...

4 years ago | 0

| accepted

Answered
I have created a code to graph a function, but I want to repeat 10 times that signal every 3 sec in time in the graph, so it looks like a periodic signal, any ideas how?
I do not understand the units if ‘t’ so I have no idea how this corresponds to the ‘10 times every 3 sec’ requirement. I will d...

4 years ago | 0

| accepted

Answered
Fourier transform to reciprocal space vs. time-frequency transform
There appears to be a very high D-C (constant offset) component. That is equivalent to the mean of the signal, so subtracting i...

4 years ago | 0

Answered
i am not able to get graph
Try this — H= 2.7; E= 1.05; V=1; g=5000000; p=5000000; f=50; dt=0.05; omega=0; base=g; G=g/base; M=(H*G)/(180*f); X...

4 years ago | 0

| accepted

Answered
Error bars not working on loglog plot
You are likely not doing anything wrong. The lower error bars are most likely negative, and values less than or equal to zero d...

4 years ago | 0

| accepted

Answered
Solving two equations simultaneously then plotting
For the first part, see if somoething like this would work — n = 1:10; m = 1:5; [N,M] = ndgrid(n,m); f = @(x,n,m) m.*x.^2 -...

4 years ago | 0

Answered
How to sum or complete surfaces obtained with the same meshgrid but presenting different data dimensions
There is not enough information to provide a specific response. If ‘A1’ and ‘A2’ and ‘B1’ and ‘B2’ have the same minimum and ...

4 years ago | 0

Answered
How to generate a legend with different values inside a loop
Try something like this — plot(x,y,'DisplayName', sprintf('E = %5d',E)) Change the sprintf format string to produce the desir...

4 years ago | 1

| accepted

Answered
Find all the peaks higher than this threshold and save the corresponding range in a variable.
Possibly: idxv = 1:numel(data(i).MaxPerRangeBin(1,:)); % Index Vector Lv = (data(i).MaxPerRangeBin(1,:...

4 years ago | 1

| accepted

Answered
I am getting the error "Array indices must be positive integers or logical values.". Anyone please help
The code calls them as functions, however addresses them as array elements, so create them as anonymous functions instead — ...

4 years ago | 0

Answered
how to apply if statement with equations
Using a ‘logical indexing’ approach instead of the if block — Cm2 = [80.105 81.868 97.935 116.429]; W2 = [82.564 83.693 98.0...

4 years ago | 0

| accepted

Answered
how to change this code to plot the frequency response of the desired interval?
That depends on what you want as the result. Two possibilities are fft and pspectrum with the 'spectrogram' option.

4 years ago | 0

| accepted

Answered
How to have this title graph?
Use sprintf instead — cycle = 42; minute = 24; title(sprintf('cycle = %.2f, minute = %.2f', cycle, minute)) Change the for...

4 years ago | 0

Answered
Taking the sum of exponentials
‘If it matters, . And is a vector of .’ I don’t see ‘t’ defined anywhere, so it depends on what relationship ‘t’ has to ‘x’ ...

4 years ago | 0

| accepted

Answered
If I have day month and Year in Xaxis, How can apply limit to the Xaxis?
If ‘x’ is a datetime array, the arguments to xlim must also be datetime values — x = datetime('now')+days(0:60); y = sin(2*pi...

4 years ago | 0

| accepted

Answered
Need to reduce the noise and get rid of high frequencies in my signal (low pass filter?)
If you have the Signal Processing Toolbox, the easiest way is to use the lowpass function. To get the most efficient filter, us...

4 years ago | 0

| accepted

Answered
Help using fsolve (theta beta mach)
The fsolve function is a root-finding algorithm, so the search must be for zeros of the function. The function needs to be expr...

4 years ago | 1

Answered
How to properly take the one-sided fft in MATLAB?
There appears to be missing information (specifically ‘G_t’ and ‘f_t’), so running the code is not possible. Otherwise: Fre...

4 years ago | 0

| accepted

Answered
symbolic matrix help converting
One problem is that ‘C’ is being used to designate the capacitor, and also the ‘ABCD’ (2,1) element. Designating the capacitor ...

4 years ago | 0

Load more