Answered
Split EMG data based on acceleration
Either the Signal Processing Toolbox <https://www.mathworks.com/help/signal/ref/findchangepts.html *|findchagepts|*> (link) or <...

8 years ago | 0

Answered
Return the value of vectors
Yes. I have no idea what you intend. Also, global variables cause more problems than they solve. Do not use them. Ca...

8 years ago | 0

| accepted

Answered
Harmonics in ECG signals
Your sampling frequency is about *|61.6|* Hz, so the line frequency certainly _could_ be aliased into your recording. Without k...

8 years ago | 0

Answered
How can i do apply operator componentwice in any vector in N dimensional space? Mat lab code for any vector in N dimension
Try this: f = @(x) 0.*(x <= -10) + 1.*((x > -10) & (x < 10)) + 2.*(x >= 10); % Anonymous Function v = randi([-99 9...

8 years ago | 0

| accepted

Answered
How to draw a tangent line on a curve
One option: Gs1 = tf([1],[1 5 10 10 5 1],'InputDelay',3); [y,t] = step(Gs1); h = mean(diff(t)); dy = gradient(y, ...

8 years ago | 11

| accepted

Answered
How to create a helix path in plot3?
I am not certain what result you want. Try this: th = 0:pi/2:2*numel(h)*pi; hv = linspace(0, H, numel(th)); ...

8 years ago | 1

Answered
Problem while using textscan
If you do not want to type the format string, just use the *|dlmread|* funciton: S = dlmread('S.txt', '\t', 1, 0) S...

8 years ago | 0

| accepted

Answered
polar plot 3d by data
I am not certain what you want. Try this: fidi = fopen('z0.txt','rt'); D0 = textscan(fidi, '%s%s%d', 'HeaderLines',1...

8 years ago | 0

Answered
Need help with butterworth function
I assume *|‘A’|* or *|‘x’|* is the signal you want to filter. If so, you are not giving it to the *|filter|* function to use. ...

8 years ago | 0

Answered
plotting matrix verses vector
The easiest solution is likely: plot(p.f, H) If *|‘H’|* is a square matrix, and you want to transpose it, use: pl...

8 years ago | 0

Answered
Saving my Plot as Jpg not working
I’m not sure what you want to do. I don’t see any commands in you code to save anything. If you want to save your plot or ...

8 years ago | 0

Answered
Curve fitting with polyfit
It depends what *|‘A’|* and *|‘eA’|* are, and the polynomial degree you want to fit. Assuming a _linear_ fit: p = pol...

8 years ago | 0

Answered
How to calculate a line-of-best-fit equation (y=mx+b) from a simple x-y dataset
No data attached. If *|‘x’|* and *|‘y’|* are vectors, either of these should work: p = [x(:) ones(size(x(:)))] \ y(:); ...

8 years ago | 1

| accepted

Answered
How to solve this ODE
Your function is nonlinear, and most nonlinear ODES do not have analytical solutions. Try this: syms y(t) A B C D E Y...

8 years ago | 0

Answered
How can I convert into new coordinates over a loop?
This task might be easier with the <https://www.mathworks.com/help/matlab/ref/sph2cart.html *|sph2cart|*> (link) function. ...

8 years ago | 0

| accepted

Answered
custum filter for biosignal
If you have *|R2016a|* or later, you can use the <https://www.mathworks.com/help/matlab/ref/movstd.html *|movstd|*> (link) funct...

8 years ago | 0

Answered
Use a matlab function as a mathematical function for plotting, differentiation
I have no idea what *|‘errvarX’|* is or does, much less how it works. I am _guessing_ here that <http://www.mathworks.com/h...

8 years ago | 0

Answered
Can anyone tell me what is wrong with this?
*_Nothing is wrong with it!_* The optimisation was successful.

8 years ago | 0

| accepted

Answered
Cant simplify an algebraic equation
It seems to slimplify nicely for me: syms A B C x g(x) = (A*(x + 1)^3 + C*(x + 1)^3 + B*(x - 1)*(x + 1)^2)/((x - 1)*(x...

8 years ago | 2

| accepted

Answered
how to plot excel data in a polar graph?
Note that *|deg2rad|* requires arguments. I am somewhat surprised not providing them did not throw an error. You do not ne...

8 years ago | 0

| accepted

Answered
How to convert [-90 90] range of elevation angel in imgradient3 to [0 , 180]?
Try this: Angles180 = @(a) rem(180+a, 360)-90; Result = Angles180([-90, 0, 90]) Result = 0 90 1...

8 years ago | 0

| accepted

Answered
solve second order ode system numerically
I would normally expect this to work for other systems of differential equations: syms k1 k2 k3 k4 k5 k6 k7 k8 u x(t) y(t)...

8 years ago | 0

| accepted

Answered
If statement that transposes a vector if the size is not according to a specified size
As a function file: function b = aTestFunction(a) b = a(:).' end as an anonymous function: aTestFunction = @...

8 years ago | 0

| accepted

Answered
Help solving 2 ODEs
Try this: PX_ODE = @(W,PX) [((-0.3743)./(2*PX(1))).*(1-(0.15*PX(2))); 0.5*((0.08*(0.75*(1-PX(2))))./(1-(0.15*PX(2))))]; ...

8 years ago | 1

| accepted

Answered
How to add fixed Colorbar based on a vector for 2D scatter plot with 3 vectors
One option is to normalize the *|‘z’|* values by scaling them with respect to the range of both *|‘z1’|* and *|‘z2’|*: fig...

8 years ago | 1

| accepted

Answered
how to plot a 3d surface using a matrix
Another option: d = sin((1:6)' * (1:181) / 90); % Creates (6x181) Matrix m = 1:6; p = 0:20:181; ...

8 years ago | 0

| accepted

Answered
For loops in MATLAB producing NaNs
The problem is that *|‘x_new’|* comes close to overflowing just before it becomes *|NaN|* in the next iteration: x_new = x...

8 years ago | 0

Answered
Solve when a Function of x and y is equal to zero.
Start with the Symbolic Math Toolbox: syms D g k1 k2 L1 L2 m x y V(x, y) = (((1/2)*k1*(sqrt(x.^2+y.^2)-L1).^2) + ((1/2...

8 years ago | 0

Answered
ODE45 - Solving a system of second order differential equations
The *|‘v(7)’|* term did not look correct to me (there should only be *|6|* elements), so I decided to let the Symbolic Math Tool...

8 years ago | 2

| accepted

Answered
Warning: Explicit solution could not be found
After using *|expand|*, many of the terms in your equation have *|‘(n - 1)^m’|*, *|‘n^(m + 3)’|*, or something similar, so an an...

8 years ago | 0

Load more