Answered
Why are my lines not showing on my graph ?
I don’t even get a straight line, because there is not such functyion as ‘rscale’ in the online documentation. That aside, lo...

5 years ago | 1

Answered
Base line removal for Raman input
One problem is that there are a lot of missing data in the chosen variables, so it was necessary to remove them first in order t...

5 years ago | 1

| accepted

Answered
How to change markers on axes to be on the opposite side and how to add more markers in between that are smaller
Try something like this — x = logspace(-4, 5, 500); y = 1-exp(-0.2*x) + sin(2*pi*x*1E-4)*0.1; figure semilogx(x, y) Ax...

5 years ago | 0

Answered
How to set values for parameters in an ODE?
syms phi(t) m l g d % sympref('AbbreviateOutput',false); d_phi = diff(phi); dd_phi = diff(phi, 2); a = g/l; b = d/(m*l^...

5 years ago | 1

| accepted

Answered
convert hourly data to daily data
Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/829100/Norwalk2_012095493_ready.xl...

5 years ago | 0

Answered
Plotting different datasets from looped ode45 using subplots.
I assume that the intended result is to have different plots representing the function with different values of ‘f’ in each subp...

5 years ago | 0

| accepted

Answered
How to save data into an array from a for loop
It is not possible to use ‘op’ as an index, so it needs to be restated to use it in that context. The ‘theta’ vector can be use...

5 years ago | 0

Answered
Obatin s domain and transfer function from the data
Start with the idfrd function and go from there. The documentation explains everything. Actually though, to analyse the circ...

5 years ago | 0

| accepted

Answered
How can I see the right labels on x-axis?
Without downloading the .mat file and running the entire code, this seems to work — newTicks = datetime({'2000','2002','2004...

5 years ago | 1

| accepted

Answered
Start/End times of Spikes, as well as duration
Try this — T = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/827850/pH_Data.csv','VariableNaming...

5 years ago | 0

Answered
Average of 5 locations for each time
This is all a bit arcane. See if the movmean function will produce the desired result. .

5 years ago | 0

Answered
can a random number generator be used in a matrix?
The randi function would be good for that, and thresholding the rand function would also work. M = randi([0 1],10) M = +(ran...

5 years ago | 0

| accepted

Answered
Contour Plots from column vector
Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/827635/Temperature%20data.txt', 'Var...

5 years ago | 0

Answered
Extracting a data vector from a looped ode45
I cannot run this because ‘odefcn’ is over the horizon. I would do something like this — % Defining parameters and initial ...

5 years ago | 0

| accepted

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 ...

5 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...

5 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...

5 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...

5 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,...

5 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...

5 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...

5 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...

5 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],...

5 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') .

5 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....

5 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...

5 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...

5 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. .

5 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...

5 years ago | 0

| accepted

Load more