Answered
Standard deviation error bars for each interpolated value of temperature
It is difficult to follow your code, so I created my own based on my best guess as to what you want. Try this — % readcell...

2 years ago | 0

Answered
Plotting the derivative of infected population SI model
You need to plot the derivatives, not the solved equations. One option is to use the gradient function: dy2dt = gradient(y(...

2 years ago | 0

Answered
Day of Week data plot
Perhaps something like this — Date = datetime(2023,1,1, 'Format','yyyy-MM-dd')+caldays(0:365).'; Cl = randn(size(Date)) + 30*...

2 years ago | 0

| accepted

Answered
label each curve on semilog graph
I am not certain what you want, however creating a legend entry for each line does not appear to be the desired result. It ...

2 years ago | 2

Answered
Create 30 minute bins by reading time stamps
What do the ‘Calculated time’ values represent? Are they fractions of a day (from about ¼ to about 3¼ days) or something else? ...

2 years ago | 0

| accepted

Answered
How to differentiate a time series while minimizing noise in the signal?
The way I prefer to minimise the noise (especially broadband noise) in a signal is to use the sgolayfilt function first (specify...

2 years ago | 0

Answered
how to average over specific dates
Your data should be in a table or timetable. Then use the isbetween function to generate a logical vector, and take the mean of...

2 years ago | 0

Answered
Need help to make a ode function asign a value
There are several problems (not the least of which is the absence of the necessary variables, so it is not possible to run your ...

2 years ago | 0

Answered
How to get finer data sampling?
Use the 'MeshDensity' name-value pair — R0 = 0.917; h0 = 1; n = 8; rk = 1; k = 1; d = 32/180*pi; Lv0 = sqrt(h0.^2+2*R0...

2 years ago | 0

| accepted

Answered
How to extract data of one solution from multiple solutions?
This can be done using the clusterdata function, followed by accumarray — R0 = 0.917; h0 = 1; n = 8; rk = 1; k = 1; d = ...

2 years ago | 1

| accepted

Answered
I am trying to get my answer to Display but it wont let me
Another option — syms f(x) f(x) = (x^3) - (7*x) + 6; x=solve(f(x)==0,x); disp(["the roots will be ",string(x.')]) Note the...

2 years ago | 0

Answered
How do I keep original headers when bulk converting CSV files to Excel and deleting everything except for three columns?
With respect to getting the original headers (variable names), with readtable use 'VariableNamingRule','preserve' (in earlier ve...

2 years ago | 0

| accepted

Answered
Find line containing word in a mixed format txt file
I am not certrain how the table actually exists in the file (and it would help significantly to have the actual file rather than...

2 years ago | 0

| accepted

Answered
How to fill the area between lines in gray shade
This becomes a bit more complicated with multiple lines. This assumes you want the gray region between the maximum and minimu...

2 years ago | 0

| accepted

Answered
How to add vertical line in z direction in YZ view meshplot?
I do not completely understand how you are creating the ‘YZ’ view. If you are creating it using ‘vlew(90,0)’ the first option...

2 years ago | 1

Answered
Drawing a bode plot of the Duffing equation, which is a special application of the integro-differential equation model.
The problem with using a two-element vector for ‘tspan’ is that the MATLAB ODE integrators do not produce regularly-spaced time ...

2 years ago | 1

Answered
Error using integral function with anonymous function
Perhjaps using integral2 instead will work here — C1 = 3.742e8; C2 = 1.4388e4; SB = 1.38*10.^-23; %Boltzmann's constant C1 ...

2 years ago | 0

Answered
Fitting model to data set by estimating parameters
The calculated ‘YSol’ should return a (Nx3) matrix where ‘N’ equals ‘numel(t)’ so if it does not, you need to determine the reas...

2 years ago | 0

| accepted

Answered
Concatenate the index i within the loop
Use the compose function — num_labels = 10; labels = compose('Node %d',1:num_labels) .

2 years ago | 0

| accepted

Answered
How to solve equation with several unknown variables for a specific variable?
The isolate function is helpful here — syms w0 g l r l a m eqn = m*g*l*(1-cos(a))==1/2*1/2*m*(r^2+2*l^2)*((r^2/(r^2+2*l^2))*w...

2 years ago | 0

| accepted

Answered
Eliminating specific data from a file
There are functions like fillmissing to interpolate the NaN entries and rmmissing to delete them (the entire row with a NaN entr...

2 years ago | 0

| accepted

Answered
Default output for ps in the spectrogram function
Apparently the default for spectrumtype is 'psd'. At least that’s how I read it.

2 years ago | 0

| accepted

Answered
Can we generate best fitted nonlinear equation between 4 inputs and 1 output, if we dont know the equation initially
Ideally, the nonlinear objective function is a mathematical model of the process that created the data. Otherwise, there are ...

2 years ago | 0

Answered
Loading variables to a specifc workspace
One option to transfer specific variables to your script (calling) workspace would be to include them as outputs of your functio...

2 years ago | 0

Answered
How do you express the root locus for k in MATLAB
Perhaps something like this — K = 1:3; % Define: 'K' (Vector) s = tf('...

2 years ago | 0

Answered
Draw the surface of a two variables function
All the variation occurs near the centre of the surface. You can begin to see that in the contour plot using surfc, however to ...

2 years ago | 0

Answered
how to plot different horizontal lines over each group of bar plot
Try something like this — A = (5+rand(10))/6; figure hb = bar(A); for k = 1:numel(hb) xep(k,:) = hb(k).XEndPoints;...

2 years ago | 0

| accepted

Answered
Plotting Multiple Shaded Uncertainties
That appears to be correct, although it would be necessary to provide the data to check for any errors. You can prevent the p...

2 years ago | 0

| accepted

Answered
Matrix dimensions do not match
Either ‘z’ or ‘jd’ has to be a (16x1) double for that to work. That discrepancy is throwing the dimension error. .

2 years ago | 0

Answered
textscan syntax help converting file
Try something like this — Array = {'Item1', 2526976, 8, 14, 11, [224,224,137,80] 'Item2', 2526976, 8, 18, 15, [224,2...

2 years ago | 0

| accepted

Load more