Answered
converting a date into a num
I have no idea what those date numbers are, since they are not MATLAB date numbers, and attempting to convert them as 'excel' or...

4 years ago | 0

Answered
Coupled Mass and energy equations using bvp4c
Ths usual solution for that is to simply increase the initial mesh size, and here that is: z = linspace(0,1,7500); It then ru...

4 years ago | 1

| accepted

Answered
How to create a frequency domain bandstop filter?
Use the fftfilt function, and the FIR filter that produces the desired result. A suitable, simple notch filter — Fs = 5000;...

4 years ago | 0

| accepted

Answered
How to list specific variable at all points except at certain values
I have no idea what the actual application is. One option: outpt = @(trial) ((trial >= 0) & (trial <= 4)).*5 + ((trial < 0)...

4 years ago | 0

Answered
How can I get the transfer function for the three filters in this code? and how to plot the magnitude spectrum for the filters transfer function?
The numerator of the transfer functions are the outputs of the fir1 calls (and the denominator is always 1). For the first fi...

4 years ago | 0

Answered
Horizontal line up to graph line
Try this — y = [0.5 1 2 3.5 6 8 10.2 14 18 21 35 41 58 60.5 66 70 90 100]; y1 = [0 0.5 1 2 3.5 6 8 10.2 14 18 21 35 37.32...

4 years ago | 1

| accepted

Answered
Extracting the specific range of data.
I have no idea what the signal looks like. It is apparently recorded rather than being processed in real time. To detect the...

4 years ago | 0

Answered
How to add regression line equation to a plot?
One approach — y = [4.0432,4.1073,4.0899,4.1319,4.2885,4.4305,4.5249,4.6172,4.6962,4.7235,4.5987,4.7927,4.895,4.9079]; x = [1...

4 years ago | 1

| accepted

Answered
How to separate Variables Names from the Data in Two Different table
Perhaps something like this — T1 = array2table(randi(99, 10, 5)) T2 = T1; T2.Properties.VariableNames = {'Alpha','Beta','G...

4 years ago | 0

| accepted

Answered
Plotting Signals in matlab
One option is to use the Symbolic Math Toolbox and go from there. Example — syms t u(t) = heaviside(t); X(t)=(t+1)*u(t-1...

4 years ago | 0

| accepted

Answered
Split vector to sub vectors of equal size
If the sampling times are uniform (constant sampling intervals between the observations) use the Signal Processing Toolbox buffe...

4 years ago | 0

Answered
Average data of 5 samples with different array length (tensile test dogbone)
They don’t all share the same ‘strain’ values, so it is only possible to compare them over the ‘strain’ values they share. Cho...

4 years ago | 0

| accepted

Answered
How can I add zeros to a vector to make a continuous time axis from a discontinuous one?
I‘m not certain what data are in the table, however the first column appears to be the length of the recordings. There do not a...

4 years ago | 0

Answered
Xticklabel to split into two lines
See: How do I create a multi-line tick label for a figure using MATLAB 7.10 (R2010a)? - This has been updated to work in more ...

4 years ago | 1

| accepted

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

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

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

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

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

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

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

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

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

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

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

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

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

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

4 years ago | 0

| accepted

Load more