Answered
why am i getting ans = Empty sym: 0-by-1
‘There’s no “there” there!’ When in doubt, plot! The plot of a funciton tells essentially everything that needs to be known ...

4 years ago | 1

| accepted

Answered
How to plot probability density curve?
For data with an unknown distribution, I generally use the empirical cumulative distribution (ecdf) function to get the CDF, and...

4 years ago | 0

| accepted

Answered
How to add trendline
There are any number of approaches, including lowpass filters of various descriptions. Another one would be polyfit and poly...

4 years ago | 0

Answered
How to plot a bode graph for a filtered output?
‘... coeffficient converted into its transfer function, [b a]=sos2tf(SOS,G).’ Do not do that! Keep it as a second-order-sect...

4 years ago | 1

| accepted

Answered
How can i plot a differential setting my own sample time?
Yes. Define the ‘tspan’ argument as a vector with more than 2 elements, for example to go from 0 to 5 with 15 sampling pints,...

4 years ago | 0

Answered
Filtering unwanted noise in Audio ECG Signal
The 5 Hz signal is well within the spectrum of the normal EKG (0-100 Hz), so a bandstop or other frequency-selective filter is i...

4 years ago | 0

Answered
Calculate days between two given months
Use the between function — t1 = datetime('7-Dec-1941') t2 = datetime('now') ElapsedDays = between(t1,t2,'Days') ElapsedDays...

4 years ago | 0

Answered
How to Remove Seasonal Cycle?
If the seasonal cycle is a narrow frequency band, and the data are sampled at consistent regular intervals, use a bandstop filte...

4 years ago | 0

Answered
how do i color this?
figure rectangle('Position',[0 0 2 4],'Curvature',0.2, 'FaceColor','r') axis equal rectangle ('Position',[0.2 3 0.7 0.9],...

4 years ago | 1

| accepted

Answered
how do i fill rectangle with color?
This is how — figure rectangle('Position',[0 0 2 4],'Curvature',0.2, 'FaceColor','r') .

4 years ago | 0

Answered
Fit power function to data (optimization)
The problem is the model. It may not be appropriate for these data. A logistic curve fits much better — xdata = [0.02 0....

4 years ago | 0

Answered
How to create a Stereo Sweep from Frequency A to B in a given time?
The built-in Signal Processing Toolbox chirp function is perfect for this — Fs = 1E+4; t1 = linspace(0, Fs-1, Fs)/Fs; s1 = c...

4 years ago | 1

| accepted

Answered
How to fix the error message, "incorrect dimensions for matrix multiplication"?
I cannot run images of code, only code text. The code needs to do element-wise multiplication — x = 0:0.1:120; p = 150; e...

4 years ago | 0

| accepted

Answered
How to get all the individuals in a table with a certain string value
See if the findgroups function will produce the desired result. .

4 years ago | 1

Answered
Change values of the first column in a txt file
It depends on the desired result in the combined file. If they are supposed to be sequential (so that the first cxolumn in th...

4 years ago | 0

| accepted

Answered
loop calculation and skipping the numbers
The indexing is incorrect. It leaves gaps. The gaps can be eliminated with a more efficient indexing approach. This fixes t...

4 years ago | 0

| accepted

Answered
syntax error for matrix
Typo: A = [3+2+1*s 1*s+2 -3; -s-2 2+1*s+2*s+4*s -2*s; -3 -2*s 3+(1/(2*s))+2s] ...

4 years ago | 1

Answered
i could not fix the error part !
The problems were that the ode23 call has to be: [t,x] = ode23(@diff2,[t0,tf],x0); so it refers to ‘diff2’ correctly as a fun...

4 years ago | 1

Answered
How to rearrange an equation in matlab to get the poles?
If the Control System Toolbox is available — %Values Vs = 1; Z0 = 50; R = 50; C = 1e-9; L = 0; s = tf('s'); %Where s = ...

4 years ago | 0

Answered
Question concerning the detection of Rate of change (positive only in this case)
First lowpass filter the signal to remove as much noise as possible. The sgolayfilt function is best for removing broadband noi...

4 years ago | 0

| accepted

Answered
Solving and plotting solution of 3rd order ODE using ODE45
If the Symbollic Math Toolbox is available, use the odeToVectorField function to create the appropriate array, then use matlabFu...

4 years ago | 0

Answered
Adding values to a matrix in for loop
Subscript ‘in’ here — values_change = values_change + in(i); and then subscript ‘values’ (the preallocation is optional, howe...

4 years ago | 1

| accepted

Answered
How to find baseline intensity in noisy mass spectra?
In the posted data, the baseline is not a constant, since there is a descending part at the left end (below about 150) before it...

4 years ago | 0

Answered
This is far past my understanding of matlab and want to understand how to code such a thing, thank you
I only see two spikes in the Fourier transformed data, one at 120 Hz and the other at 240 Hz. A FIR filter can elimiated both s...

4 years ago | 1

Answered
How to keep yticklabels intact after reversing the Y-axis
Just change the labels — x = linspace(0, 100); y = [20:20:80].'*exp(-(x-50).^2/75); figure plot(x, y) grid title('Ori...

4 years ago | 1

| accepted

Answered
Need plot for time rather than samples
If the time vector does not already exist, create it — Signal = sin(2*pi*(0:999)*0.01) + randn(1, 1000); % Create 'Signal' ...

4 years ago | 0

Answered
How to use coeffs to a minimum power
One approach — syms x eqn(1,:) = 5*x^2 + 2*x + 8; eqn(2,:) = 42*x^3 + 3*x^2 + 3; eqn for k = 1:numel(eqn) [cfs...

4 years ago | 0

| accepted

Answered
How to generate a signal using exponential forier series?
I have no idea what the Question actually is, however generating a Fourier series from disconnected lines is straightforward, if...

4 years ago | 0

| accepted

Answered
Nyquist and bode plots
It the System Identification Toolbox is available, start with the idfrd function and go from there. The documentation is relati...

4 years ago | 1

| accepted

Answered
Solving system with ode45
‘I need to get 10 lines for each variable.’ This implies that one (or more) parameters must be varied 10 times and then integ...

4 years ago | 1

| accepted

Load more