Answered
How to change the colour of the markers on a scattered graph?
Try this — LD = load('aw_w14_scans.mat'); BMC_14_whole = LD.BMC_14_whole; BMC_14_whole_sum = sum(BMC_14_whole,2); boxplot...

5 years ago | 0

| accepted

Answered
How can i optimize the code and connect the functions?
The syms call is not necessary. Try something like this instead: % syms x f= @(x) (eta_l.*eta_0.*(((-sigma_f.*v_f.*l_c)./2...

5 years ago | 0

| accepted

Answered
lsqcurvefit error: requires all values returned by functions to be of data type double
The ‘F’ function does not appear to represent the data correctly. I revised it slightly. This should get you started: Data...

5 years ago | 0

| accepted

Answered
Matlab isn't ploting the function
I do not have any of the data, however I believe that I understand the problem: for x=logspace(-6,2) y = x.^2; end fi...

5 years ago | 0

| accepted

Answered
How can I change the color of the median line in boxchart?
It is not possible to change the colours, however it is possible to over-plot the median lines — x = randn(5); ...

5 years ago | 2

| accepted

Answered
the weight of the weighted fitting
See the Wikipedia article on Weighted least squares for an extended explanation. Essentially, the weighting is applies to the...

5 years ago | 0

| accepted

Answered
defining string variable in fprintf function
Try this — fid = 1; % Write To Command Window result_1=10.5; result_2=9.9; ...

5 years ago | 1

| accepted

Answered
finding a solver in matlab to solve an equation
I am not surprised that the numerical solvers are having problems with it! syms x Eqn = 2^((2*10^6)/x)-((1.5536*10^(-51)*x)...

5 years ago | 0

Answered
If statement for cells
The && are ‘short circuit’ AND operators. The second expression (after the &&) will not be evaluated if the first expression is...

5 years ago | 2

| accepted

Answered
Error using plot vectors must be the same length
It’s not easy to determine what the problem is. One possibility is to use the gradient function instead of using diff to calc...

5 years ago | 1

Answered
Filter out misalignment of sensor signal
I have no idea what ‘perfectly aligned axis’ means. If you want to remove the baseline trend, the best option for this signal...

5 years ago | 1

| accepted

Answered
How do I interpolate the remaining part of my signal?
If you have R2016b or later, see if the fillmissing function will do what you want. .

5 years ago | 1

| accepted

Answered
Animate 2D coordinate plot
Try this — D1 = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/678468/Clcoords.xls'); figure h...

5 years ago | 0

| accepted

Answered
How to removed dashed lines in fplot
The dashed lines indicate singularities, and I find them helpful. They can’t be removed, however it is possible to get the XD...

5 years ago | 1

| accepted

Answered
Specify value on a contour with a value that is not in the matrix, it is possible ?
Yes. Use the levels argument. M = (-1:0.11:1).'*(-1:0.9:1); figure contour(M, 'ShowText','on') hold on contour(M, [0...

5 years ago | 0

| accepted

Answered
How to find tangent line on the straight part of a graph?
This is likely straightforward. See for example: How to draw tangent line at infleciton point? and How to draw a tangent l...

5 years ago | 0

Answered
pspectrum power spectrum or power density scaling
Look carefully at the units, specifically for periodogram pxx, and for pwelch pxx. Compare these with pspectrum p. I prefer...

5 years ago | 0

Answered
Fit an exponential curve
Try this — x=[6.5 2.45 2.7 1.85 2.25 1.35 1.4 1 0.7 .475 .66 .475]; y=[0.40 0.80 1 1.40 1.80 2.50 3.00 4.00 6.00 7.00 8.00 9....

5 years ago | 0

| accepted

Answered
I don't understand how to use the sgolay function for signal edges
That code snippet runs for me without error in R2021a (and in the online Run feature, also using R2021a). I suspect you are u...

5 years ago | 0

Answered
How to change order for different filters?
Those functions have a second output, the digitalFilter object. Return that and all the information you want about the type of ...

5 years ago | 0

| accepted

Answered
How can i add text in animated line
Try this — figure h = animatedline('linewidth',2); axis([1 7 1 7]) axis ij grid on x=1:4; n = 100; xx=linspace(x(1),x...

5 years ago | 0

| accepted

Answered
Stop line after intersection with other line
I am not certain what you want. If you want lines to only go an intersection of another line, try something like this — x = l...

5 years ago | 1

| accepted

Answered
How to skip parameters in a function call
See the documentation section on Support Variable Number of Inputs for a demonstration of how to do that.

5 years ago | 1

| accepted

Answered
Multiply matrix by each element of a vector without a for loop
This may be considered ‘cheating’, however it does meet the requirements: A = [1,1;1,1]; v = [1,2,3]; vr = repelem(v,2,2) A...

5 years ago | 0

Answered
Building a wrapper around script
This appears to run correctly, saving ‘t’, ‘v’, and ‘r’ as cell arrays. (I limited ‘total_i’ and ‘j’ each to 2 in my test.) I ...

5 years ago | 0

| accepted

Answered
Plot with 3 Variables
If I understand correctly, the scatter function (or a combination of scatter and plot if you want the points connnected with l...

5 years ago | 1

| accepted

Answered
How can I extract exact values from a single column of a matrix?
Try something like this — M = randi(50, 50, 3)/1000 % Original Matrix Lv = M(:,1) == 0.025 ...

5 years ago | 0

| accepted

Answered
Why do I get "array indices must be positive integers or logical values" when trying to solve a differntial equation?
Express ‘Dx’ as a function of ‘t’ — syms x(t) Dx(t) = diff(x(t)); equ = diff(x,2) == -6*diff(x(t))-6*x-cos(3*t)-10*sin(3*t...

5 years ago | 0

Answered
merge two arrays into one
One option is simply to add them: charge_amount = [ 1 2 3 4 5 0 0 0 0 0 1 2 3 4 5]; discharge_amount = [ 0 0 0 0 0 -1 -2 -3 -...

5 years ago | 0

| accepted

Answered
Change stem colour of particular values
Try something like this — x = 1:10; y = rand(size(x)); figure stem(x, y) hold on stem(x([1 3 5]),y([1 3 5]),'g', 'Marke...

5 years ago | 0

| accepted

Load more