Answered
Curve fitting with loglog data
Fit it to a power function: LD = load('msd_help.mat'); m = LD.m; s = LD.s; fcn = @(b,x) x.^b(1).*exp(b(2)); B = fminsear...

5 years ago | 0

| accepted

Answered
Create a timetable for every minute in one day
Without a date, it creates a duration array, not a datetime array. The two are different, especially with respect to 'Format' o...

5 years ago | 0

Answered
Hide peaks ticks and number on plots
There is likely no way to select only those peaks, since there does not appear to be anything that distinguishes them, unless th...

5 years ago | 1

Answered
I get a Warning from scatteredInterpolant.
‘Should I be concerned about this warning?’ Probably not, unless the result of the interpolation does not correspond the the ...

5 years ago | 0

Answered
Confuction with cutoff frequency
The first red line (at 0.357) corresponds to the low cutoff frequency. The upper cutoff frequency should be at 2.856, so the se...

5 years ago | 0

| accepted

Answered
Insert column of strings into numerical matrix
Use a table array instead of a matrix. .

5 years ago | 0

Answered
Plot multiple curves with filled markers
One approach — x = linspace(0,10); v = 1:5; y = v(:)+sin(2*pi*v(:)*x); cm = colormap(jet(size(y,1))); figure hold on f...

5 years ago | 0

| accepted

Answered
Is this the correct way to use "hold on" in a for loop?
‘Is this the correct way to use "hold on" in a for loop?’ That is not the way I would do it. Try this instead: figure h...

5 years ago | 0

Answered
Find coordinates of border in findpeaks plot
Using an example from the findpeaks documentation — x = linspace(0,1,1000); Pos = [1 2 3 5 7 8]/10; Hgt = [4 4 2 2 2 3]; ...

5 years ago | 1

| accepted

Answered
Convert Time Given in Seconds to Minute, Seconds, Milliseconds
This is simply a straightforward format change: t = seconds(183.55) t.Format = 'hh:mm:ss.SSS' producing the desired result. ...

5 years ago | 2

Answered
Error finding Linear Regression with polyfit and \
There is a NaN value in the temperature data. Try this: LD = load('data.mat'); data = LD.data; x = data.LOCAL_DATE; xd...

5 years ago | 0

| accepted

Answered
How to find tangent line of curve
See: How to draw a tangent line on a curve .

5 years ago | 0

Answered
plot 2D matrix data
The pcolor function requires a matrix argument, and the data provided here are a (5000 x 3) matrix with ‘X’, ‘Y’ and ‘Z’ columns...

5 years ago | 0

| accepted

Answered
How can I differentiate an abstract symbolic function?
I am not certrain that I understand what you want to do. See if the diff documentation section on Differentiation With Respec...

5 years ago | 0

Answered
I want to find the value of two constants from an equation with two variables
@NDC — To estimate the initial parameters for this, since is known, the asymptote as will be , and that gives a way to estim...

5 years ago | 0

| accepted

Answered
Why do I receive "Error using lsqcurvefit (line 251) Function value and YDATA sizes are not equal."
Do element-wise division F2 = @(x,xdata)(x(1)*sin(xdata*pi/180)*(1-exp(-50*x(2)))./(1-cos(xdata*pi/180)*exp(-50*x(2)))); ...

5 years ago | 0

| accepted

Answered
Cells detect and Cells numers in array
M1 = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/701747/1.xlsx') time_desired = [0, 10, 60, ...

5 years ago | 0

| accepted

Answered
Aligning 2 Signals as a function of third signal
I am not certain what you want to do. See if the alignsignals function will do what you want. Another option may be findsign...

5 years ago | 0

| accepted

Answered
Making a 2d scatter plot with multiple data sets and color map
Use the third argument of scatter to determine the size of the points, and the fourth argument of scatter to determine the colou...

5 years ago | 0

Answered
How do I plot my differential equation on Matlab?
Of copurse it’s going to be a straight line! After evaluating the functions, look at ‘(tval,Vp)’ and ‘(tval2,V)’. They are al...

5 years ago | 0

Answered
How to Overlay Curve Fit Over Bar Plot Without Overriding Data?
Include the independent variable ‘Year’ in the bar call, and change the xlim values: Year = 2013:2019; Video_Cost = [11.09, ...

5 years ago | 1

| accepted

Answered
How to plot specific range of values in a plot?
Perhaps: plot(X([2:5 7:end]),Y([2:5 7:end]),'ko') Create vectors with specific values by enclosing them in square brackets []...

5 years ago | 0

| accepted

Answered
Please assist! Z1= exact solution; Z2= approximate solution. Now i want to plot a 2D graph of the exact and approximate solution in ONE graph to campare the results
Try this: alpha=1; t=0.004; [x,t] = meshgrid(-4:.1:4, 0.1:.2:0.4); exact=(sech(x/4-t/4)).^2; f0=(sech(x/4)).^2; f1=(s...

5 years ago | 0

| accepted

Answered
Ode 45 / Ode xx: Solve time depending system of equations (2nd order)
The clear and clc calls are not necessary, global variables are never advisable, and the syms call is also not necessary. Creat...

5 years ago | 1

Answered
Reorganization of experimental data
The data file you attached does not appear to bear a strong resemblance to the data file you quoted. I chose to use textscan ...

5 years ago | 0

| accepted

Answered
Finding the intersection points between two curves
Several options — h=20; K=13.6; l=1148e-6; f1 = @(beta)tan(beta*l); f2 = @(beta)2*h*beta*K./(K^2*beta.^2-h^2); figure ...

5 years ago | 0

| accepted

Answered
How can i calculate PDF and CDF of non-parametric distribution?
I am not certain what your data are. If ,they are appropriate for the function, I would begin with the ecdf function, since it ...

5 years ago | 1

| accepted

Answered
Issue solving a non-linear differential equation in Matlab
‘Am I wrong?’ No. The result is not always as simple as it might be. In R2021a, the Symbolic Math Toolbox apparently simp...

5 years ago | 0

| accepted

Answered
isosurface with wall thickness
There does not appear to be any way to change the thickness of the plotted surface. The best I can come up with is the revise...

5 years ago | 0

Answered
How can I plot integral of this equation?
Try something like this — % clc; figure('color','white'); while(1) sigma.phi=input('Enter 0.1 in a.u.: '); mu=input('Enter...

5 years ago | 0

| accepted

Load more