Answered
matrix, value, comparing
One option is pdist2 — MA = [0 4.4710 8.8828 13.6977 17.7027 21.7184]; TA = [0 5.0490 9.3733 ...

5 years ago | 0

| accepted

Answered
SYMBOLIC integration often gives complex integrands
I have absolutely no idea what the actual question is, however a possible solution would be the assume function. Experiment! ...

5 years ago | 0

Answered
Subs with 2 numbers returns a number
It is doing the substitution and the calculation at the same time, and providing the answer. Using symbolic arguments instead...

5 years ago | 0

Answered
plotting values that comes from a if else loop
I am not certain what you are doing, so I cannot suggest specific changes. The ‘Prf’ value plots, however it is a scalar so t...

5 years ago | 0

Answered
Legend with 15 colors
Try this — x = linspace(0, sqrt(300), 15); y = x; z = x(:)*y; figure surf(1:15, 1:15, z) grid on colormap(turbo(15))...

5 years ago | 1

| accepted

Answered
I need a picture of a graph similar to the one I posted
Add these calls after the surf call — colormap(turbo) shading('interp') The surf plot should then be close to what appears t...

5 years ago | 0

Answered
How to create a colored, with three equally spaced rows of colors horizontally with a dimension of 6x5x3
Try this — yellow = [1,1,0]; orange = [0.8500,0.3250,0.0980]; pink = [1, 0.5, 0.8]; tci = cat (3,yellow,orange,pink); x ...

5 years ago | 2

| accepted

Answered
Log normal Distribution Equation
Since the objective is to use MATLAB for this eventually, see the documentation section on the Lognormal Distribution. .

5 years ago | 1

Answered
Datetimes don't seem to be recognised
I’m not certain what you’re doing and I can’t run the posted code. I’m also not certain what the actual problem is. See if t...

5 years ago | 0

| accepted

Answered
how do you make a scatter plot with categorical data with connecting lines?
The data being used would help produce an appropriate response. The ‘connecting lines’ request eliminates scatter as an opt...

5 years ago | 0

| accepted

Answered
How to convolve signal and transfer function
Try this — t = linspace(0, 10) u = @(t) heaviside(t); Vin = @(t) u(t)-u(t-3); h = @(t) ( exp(-2*t)/6 ) + ( 3/16*exp(-t) )...

5 years ago | 1

| accepted

Answered
I want to read a text file that contains both text and numbers. How can I extract just certain values from it?
Try this — WingTable = readtable('FileName.txt', 'NumHeaderLines',4, 'VariableNamingRule','preserve') See the documentation f...

5 years ago | 1

| accepted

Answered
Poly with negative coefficients reverses the order
Use flip on the symbolic result instead — P=[1 -16]; %P = fliplr(P); %with or without it makes no difference syms x f =...

5 years ago | 1

Answered
fsolve yields wrong answer
Give fsolve a complex initial estimate to get a complex root — F = @(x)((x-20.6667).^2+57.89); opts = optimoptions('fsolve'...

5 years ago | 0

| accepted

Answered
Plotting the parametric curve and its second derivative
Is that is necessary to subscript ‘k’ so that it is the same size as the other elements in the calculation — t = linspace(0...

5 years ago | 1

| accepted

Answered
How to write a code that counts how many numbers inside a vector is less than a specific vector?
Try this — k = unifrnd(1,20, 1, 1000); for k1 = 1:19 Exceeds(k1,:) = nnz(k>k1); end Value = 1:19; DesiredResult =...

5 years ago | 0

Answered
putting error bars on bar plot?
I do not remember when ‘XEndPoints’ and ‘YEndPoints’ were introduced (and I am not able to find it in the documentation), so I i...

5 years ago | 1

| accepted

Answered
How to add subscript in xticklabels?
Try something like this — figure Ax = axes; plot(Ax, 0:2, randn(1,3)) xticks(0:2) xticklabels({'SA(MO)$_{2}$H','RSMOH','...

5 years ago | 0

Answered
Using ode to solve a specific differential equation
Try these — % k*(dT/dt)= A*Q(1-b(T)) - S*c*E*(T^4) odefcn = @(t,T,a,b,c,E,k,Q,S) (a*Q*(1-b*T) - S*c*E*(T^4))/k; ...

5 years ago | 1

Answered
Why bandpass filter doesn't do what it supposed to do?
I do not see what the problem is. t = linspace(0,1,1080); original = sin(100*2*pi*t)+1; LFnoise = sin(5*2*pi*t)+1; HFnoi...

5 years ago | 0

Answered
How can I interpolate time?
Apparently ‘tim1_1’ is not a datetime array. tim1_1 = linspace(0, 1.737857815507103e+03, 51); lam_1 = sin(2*pi*1E-3*tim1_1);...

5 years ago | 0

| accepted

Answered
Export 2 Dimension out of a 3 dimensionoal Array
I am not certain what is the desired result. Usually, the intent is to separate the ‘pages’ (third dimension) of the array in...

5 years ago | 0

Answered
how to numerically solve a coupled ode?
Use the Symbolic Math Toolbox for this. First, declare all the appropriate variables as functions of time: syms theta(t) ph...

5 years ago | 0

| accepted

Answered
I need to make 3d Matrix out of a 2d matrix
Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/793254/Mechanical_loud.xlsx', 'Varia...

5 years ago | 0

| accepted

Answered
Which filter do I have to use?
See if the groupsummary function produces the desired reault. It will be necessary to experiment with it. .

5 years ago | 0

| accepted

Answered
Plotting Kinetic Model Monod, Haldane With Parameters
The problem is that in this assignment — dCdt(2,:) = (-(1/YXS)*dCdt(1))+(-(1/YPS)*dCdt(3))+(-Miusx*C(1)); ‘dCdt(3)’ has not y...

5 years ago | 0

| accepted

Answered
Input argument for ode45 function type error
Yes. Create it as an anonymous function at the outset — tspan = [0 10]; x0 = 0; f = @(t,x) (-4.76e+1*x^2 + 5.69e-9*x + 7....

5 years ago | 0

| accepted

Answered
How do I set the value of Y axis =0.02, and the plot will show me the value of x?
Use the interp1 function — x = logspace(-1, 2, 50); y = -x.^3; yi = -0.02; xi = interp1(y, x, yi) figure loglog(x, ...

5 years ago | 0

Answered
changing the time zone for two datetime objects then comparing them
See the datetime assiciated documentation section on Specify Time Zones. .

5 years ago | 1

Answered
Please, help me fix the first code. why is 1st code not working but the 2nd code is?
Since ‘Ca’ is actually a function of ‘X’ it has to be coded as such — Ca = @(X) (Cb0*((Ca0/Cb0) - X)); Ca0 = 8.24; Cb0 = 0...

5 years ago | 0

Load more