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

Answered
How do I change the output for an equation involving specific columns of a matrix (F) to only have one column?
‘How do I make this equation: Sa_e = F(:,1)/F(:,5); just 1 column? ’ Use element-wise division (./) instead of array division (...

5 years ago | 1

| accepted

Answered
Matlab legend is not working well
It would help to see the code that produced that plot. Also, if the computer has an AMD graphics card, updating the graphics ...

5 years ago | 0

Answered
Increase the height (size) of subplots
One approach — figure subplot(5,1,1) plot(rand(10),rand(10),'-'); subplot(5,1,2) plot(rand(10),rand(10),'-'); subplot(5...

5 years ago | 0

Answered
How to update during ODE45
If the relationship between torque and speed (angular veolcity) is known and can be modeled (expressed mathematically), create a...

5 years ago | 1

| accepted

Answered
Does anyone know how can I create the colours brown,violet and orange?
My best attempts — brwn = [200 100 16]/256; vlet = [160 81 151]/256; orng = [240 100 10]/256; figure patch([0 1 1 0], [0...

5 years ago | 0

| accepted

Answered
Contour plot in 2D using x,y,z data
Try this — Summer2015 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/791769/Summer2015.txt', 'V...

5 years ago | 0

| accepted

Answered
Extracting time from timestamp
See my Answer to the essential duplicate of this Extracting time from datetime With respect to eliminating the connecting lin...

5 years ago | 0

| accepted

Answered
Find first n roots of transcendental equation
First, plot the funciton — a = 0.9092; myfun = @(lam,a) tan(lam*pi/2)-lam*pi/2+(4/a^2).*(lam*pi/2).^3; % parameterized functi...

5 years ago | 0

Answered
Standard deviation of 2D array
The standard deviation of a scalar is 0 so the result is — standard_deviation_v = zeros(size(v)) in this instance. .

5 years ago | 0

| accepted

Answered
Extracting time from datetime
Try this — C = {'12/01/2000 01:00:00' 30; '13/01/2000 01:15:00' 45} ct = datetime(C(:,1), 'InputFormat','dd/MM/yyyy HH:m...

5 years ago | 3

| accepted

Answered
How to remove dashed vertical line in graph
Try this — In the ‘Joint1’ plots — h = diff(h); hfp1 = fplot(h,'-.','Color','#77AC30'); hfp1.ShowPoles = 'off'; I made th...

5 years ago | 0

| accepted

Answered
How to get rid of the Error in Transcendental equation ?
The problem is that ‘Eqn’ has no solution. The symbolic result is an empty vector, and that is throwing the error. The fsolve...

5 years ago | 0

| accepted

Answered
Some one help me in this.
Since ‘us’ is a scalar, any index other than 1 will throw an error. Since the desired result is likely multiplication, and MA...

5 years ago | 1

| accepted

Answered
Issue with FFT/Power Spectral Density
Subtract the mean of the EKG data before calculating the fft. Also, it likely needs to be rescaled, because the amplitude shoul...

5 years ago | 0

| accepted

Answered
How to convert complex number to real number
It depends what the desired result is — format long G a= 10266; b= 3451i; z = a+b phasorr = [abs(z) angle(z)]; phasorr(...

5 years ago | 1

| accepted

Load more