Answered
What is a more efficient method of increasing non-zero entries by one
I am not exactly certain what you want to do, however it is straightforward to do this using logical indexing — R = [0, 0, 4, ...

5 years ago | 0

| accepted

Answered
is poctave function working ?
The code you posted runs correctly in R2021a, since it runs correctly in the online Run feature here that uses it — Fs = 44.1E...

5 years ago | 0

| accepted

Answered
Undefined operator '*' for input arguments of type 'categorical'.
I am not certain what the problem is, and some information is not available. Try something like this — sample = readtable('...

5 years ago | 1

| accepted

Answered
Export/Copy Plot Line Values
Try siomething like this — x = 0:10; y1 = x.^2; y2 = 50*sin(2*pi*x/10)+50; figure hp = plot(x, y1, x, y2); Line1X = hp...

5 years ago | 1

| accepted

Answered
Error in multiplying corresponding elements in two matrices
It is often confusing to use ‘l’ (lower-case letter ‘L’) and ‘1’ (number ‘1’). I suspect that is the problem.

5 years ago | 1

| accepted

Answered
Find difference between two measurements
Without knowing what the data are, one option would be to use interp1 to determine the same values at specific times. I have ...

5 years ago | 0

Answered
Solve 3 unknown variable system of equations
There are likely an infinity of solutions. Also, for whatever reason, the solve function does not like ‘L6’. A numeric a...

5 years ago | 0

| accepted

Answered
Error using sym>convertChar (line 1537) when solving an ODE using laplace transform. How to fix the problem?
Eliminate the single quotes, use double equal signs in the symbolic expression, express ‘x’ as ‘x(t)’ in the syms declaration (o...

5 years ago | 1

| accepted

Answered
Curavture/Slope Filtering
One approach could be to look for changes in the slope (using the gradient function here) with respect to the number of elements...

5 years ago | 1

| accepted

Answered
How can I find the heart rate and R-R time interval for ECG Signal?
Getting the information from the file was something of an adventure! I likely could have done this with detectImportOptions, ho...

5 years ago | 1

| accepted

Answered
Help me with Graph plot
One approach — syms x y = 6*x^3 - 37*x^2 + 37*x - 10 figure fplot(y) grid .

5 years ago | 0

Answered
Solve the 2-nd order differential equations y"+2y'=3x
One approach would be to do this symbolically and solve it using the dsolve function.

5 years ago | 0

| accepted

Answered
Error with ode45
Supply the ‘t’ argument even if the code does not use it. Try this — t=[0 5]; inity = 1; [t,y]=ode45(@f, t, inity); plot...

5 years ago | 0

| accepted

Answered
Data import and Header Line
There are several ways to do this, likely the easiest is to use the readmatrix function (introduced in R2019a).

5 years ago | 0

| accepted

Answered
Error while using cellfun with a function
Try this instead — RRTrain1 = cellfun(@(x)RRfeatures(x),XTrain,'UniformOutput',false); I have no idea if that will do what yo...

5 years ago | 1

| accepted

Answered
Strange curve fitting with large polynomial degrees when using polyfit
As a general rule, a polynomial fit with a degree grater than 7 is likely not appropriate, so a 100 degree polynomial is giving ...

5 years ago | 1

Answered
How to group companies by SIC codes
The discretize function could be appropriate for this.

5 years ago | 0

Answered
3D plot from excel
Try something like this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/616758/Shear%20stress...

5 years ago | 1

| accepted

Answered
Adding a single number to an entire matrix
Exactly as you wrote it! a = 5 b = [1,2,3;4,5,6;7,8,9] c = a + b Use square brackets [] to code vectors and matrices.

5 years ago | 1

Answered
Frequency domain and time-frequency domain for sae data
The pspectrum function can likely help with this, specifically with respect to the time-frequency plot.

5 years ago | 0

| accepted

Answered
Help with conditional statement
My approach to these problems is to take advantage of MATLAB’s logical vectors. So for example, if I wanted to construct a fu...

5 years ago | 1

Answered
Add constraints to nonlinear multiple data sets fit
The nlinfit function will not allow parameter constraints. Use lsqcurvefit for that instead. Note that it is then possible t...

5 years ago | 0

| accepted

Answered
Use input from an array in a function
The ‘plan’ array is not being passed to your function, and since the function has its own workspace (that it does not share with...

5 years ago | 1

| accepted

Answered
Solving state space equation by ode45
The MATLAB ODE solvers are adaptive, and so will solve with as narrow a difference in the time steps as necessary to produce a s...

5 years ago | 0

| accepted

Answered
How do i write this differential equation in matlab?
There are several options, including using the numerical solvers. This approach uses the Symbolic Math Toolbox — syms C R u...

5 years ago | 0

| accepted

Answered
Multiplication of envelope function to that of sine wave
I would just use the same value (either ‘t’ or ‘ts’) for both — t = 0:1e-4:0.1; ts = 0:1e-4:0.4; T = [t ts]; x = (1+square(...

5 years ago | 0

| accepted

Answered
Read a table with numbers and strings
I would use the readcell function (introduced in R2019a), then create a table from the processed data to determine how best to r...

5 years ago | 2

| accepted

Answered
High-pass filter
It could work, however a better option could be: Fca = 2; Fsa = 1000; ...

5 years ago | 1

| accepted

Answered
Please explain how do I get A and E from the question?
It is not obvious to me how the file data relates to the expression. I assume this was discussed in class, or in other parts of...

5 years ago | 0

Answered
Can you please explain how did he found the function?
I am not certain what you are asking. If it is to understand this — fun=@(x,V,F,k,n,c0) (x./(k*c0^n*(1-x).^n))-V/F; % param...

5 years ago | 0

Load more