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

Answered
How do I combine multiple plots separately on one figure?
The two options are subplot and stackedplot. I use subplot here — figure(1) R1 = 6; R2 = 2.5; R3 = 2; time = 0:0.01*pi:...

5 years ago | 1

| accepted

Answered
Convert from Coordinated UTC to datetime?
A different approach — format long g nr = 1.511092230713565e+05; dt = datetime(num2str(fix(nr)),'InputFormat','yyMMdd') + ti...

5 years ago | 0

Answered
EEG Channel Data Filtering
The first step would seem to me to calculate the fft of the raw data to see what the frequency content is. Since neither the ...

5 years ago | 0

Answered
Plot columns of data in discrete datapoints?
Try this — Z = [1 2 1; 2 2 1; 1 1 3]; Y = size(Z,2):-1:1; figure hold on for k = 1:numel(Y) X = Z(k,:...

5 years ago | 1

| accepted

Answered
How can I fix the "vectors must be same length" error?
The posted code doesn’t provide a lot to work with. If ‘T’ is a column vector, ‘t’ will be a scalar equal ot 0, and that could ...

5 years ago | 0

| accepted

Answered
How to switch to this graph? Mathematical question
Try this — x = [0 0.5 1]; a = [1 0.2 0.2]; b = [0 0.4 0.4]; c = [0 0.4 0.4]; figure patch([x flip(x)], [c zer...

5 years ago | 1

| accepted

Answered
Accelerometry design filter and outline
Consider decreasing ‘Fpass2’ and ‘Fstop2’ since they are obviously not filtering out the high-frequency noise. To design the ...

5 years ago | 0

| accepted

Answered
Fourier transform of symbolic function
Use the fourier function. I’m guessing as to what ‘wilberforce_y’ and ‘wilberforce_z’ are. syms t omega T syms y(t) z(t...

5 years ago | 0

| accepted

Answered
how to make a list of coordiantes (x, y, z)
It is not possible to use the original vectors because they have different lengths (1x10) and (1x20). That aside, drawing a ...

5 years ago | 0

Answered
Generating a pulse signal
The posted code is an extremely cumbersome way of coding an extremely straightforward problem. The ‘fcn’ function here should...

5 years ago | 0

Answered
Using an improper transfer function in simulink
See: How can I implement an improper transfer function (without delays) in Simulink? .

5 years ago | 0

Answered
How to smoothen the curve in Matlab, preserving the original data points at a acceptable level?
I am not certain what the desired result is. It is straightforward to force a curve to have a zero intercept, although the code...

5 years ago | 0

| accepted

Answered
Plotting Kinetic Model Monod, Haldane Equation
I got it to run correctly, however I made no other changes (and there need to be other changes), leaving those for you. It is...

5 years ago | 0

| accepted

Answered
trying to plot a harmonic function, but i keep getting an fplot error.
Try this — syms x y u = x^2 - y^2; figure hold on for c = 2:2:20 result = solve(u == c); fplot(result) end ...

5 years ago | 0

| accepted

Answered
XData and YData from area chart
Add (cumsum) ‘Y’ row-wise to get the coordinates — t = 1:10; Y = randi(9, 10, 3) Ycoordinates = cumsum(Y,2) figure h =...

5 years ago | 1

| accepted

Load more