Answered
Too many arguments error
The current online documentation is for *|R2017b|*. The function could have changed in the last year. (I don’t use *|taylor|* ...

9 years ago | 0

Answered
FFT not giving the desired result
You did not state what your sampling frequencies are, or include them in your files, so I assume they is the same for both files...

9 years ago | 1

| accepted

Answered
Extract N number of digits after the dot
You can use the most recent version of the *|round|* function, or use this emulation of it: roundn = @(x,n) round(x .* 10....

9 years ago | 0

| accepted

Answered
Need help with Least Squares fit problem! Not overly difficult I don't believe.
Use the MATLAB <https://www.mathworks.com/help/matlab/ref/mldivide.html *|mldivide,\|*> (link) function to calculate the least-s...

9 years ago | 1

| accepted

Answered
How to convert jpg matrix to binary matrix
Try the *|im2bw|* or the *|imbinarize|* functions in the Image Processing Toolbox. See the documentation on them for necessary ...

9 years ago | 0

Answered
Matrix dimension problem with integrals
The easiest way to solve that is to use the *|linspace|* function to define *|‘x’|* and *|‘y’|*. It allows you to specify the _...

9 years ago | 1

| accepted

Answered
Not enough input arguments error when using fimincon
The optimisation routines accept a vector of parameters, so you need to write your function in that context. Try this: ...

9 years ago | 0

| accepted

Answered
How can i find this minima?
One approach is to use *|diff|* or *|gradient|* to calculate the approximate derivative of your data. Then ‘threshold’ the _neg...

9 years ago | 1

| accepted

Answered
How to check the sum of a fixed row interval, as the interval steps forward by 1 throughout a 8784x1 vector?
The <https://www.mathworks.com/help/matlab/ref/movsum.html *|movsum|*> (link) function (introduced in *|R2016a|*) will probably ...

9 years ago | 0

Answered
find intersection of refline and function
Since I don’t have your data, this is just a _guess_: Umix2_fun = @(T) UNasa(T,Sp(iSp1))*YiO2+UNasa(T,Sp(iSp2))*YiN2+UNasa...

9 years ago | 0

Answered
Hi. I want creat a tranfer function have parameter,but i don't know how to do it.help me pls
If you are creating a ‘tunable’ system, see the documentation on the <https://www.mathworks.com/help/control/ref/realp.html *|re...

9 years ago | 1

Answered
phase plotting symbolic system of equations (using ezplot and dsolve)
You have to supply numeric (not symbolic) initial conditions: [xSol(t), ySol(t)] = dsolve(odes, x(0)==1, y(0)==1);

9 years ago | 1

| accepted

Answered
Unable to fit hyberbolic curve to this data
What particular hyperbolic curve do you want to fit? The ideal gas law? One option is here: <https://www.mathworks.com/mat...

9 years ago | 0

Answered
Hi. im attempting to create a simple input command and tab it with \t however when i run the code the (t) still appears in the command window
If you want to use the formatting commands, you need to include a *|sprintf|* call to implement them. This _should_ produce...

9 years ago | 0

| accepted

Answered
Plotting a sequence using stem()
You need to vectorise the division as well: y = sqrt((3+2*x.^2)./(8*x.^2+x)); ↑ and ideally plot ...

9 years ago | 1

| accepted

Answered
Question about using ODE45
You need to vectorise *|‘Myfunc’|*. You also need to check the initial condition, since a zero initial condition results in a u...

9 years ago | 2

Answered
Average array values based on identical values.
One approach: A=[1.0 2.0 0.5; 1.0 4.0 0.5; 1.1 2.0 0.5; 1.1 4.0 0.6]; [Au,ia,ic] = unique(A(:,[1 3]), 'rows'); ...

9 years ago | 1

| accepted

Answered
How do I find the best fit line of data without the polyfit command?
This is a fairly trivial problem in MATLAB. I will give you _one_ hint: DM = (x(:) * ones(1,N+1)) .^ (N:-1:0); ...

9 years ago | 1

Answered
Solve a system of three ODE
The Symbolic Math Toolbox cannot find an analytic solution for your system. The next best option is to create an anonymous func...

9 years ago | 0

| accepted

Answered
why do I get the error: Undefined function or variable 'a'.?
The problem is the way you index your *|for|* loop: for m=6:3 The <http://www.mathworks.com/help/matlab/ref/colon.html ...

9 years ago | 1

Answered
Making the best fit for this data
First, use the <https://www.mathworks.com/help/matlab/ref/polyval.html *|polyval|*> (link) function to evaluate the fit you got ...

9 years ago | 1

Answered
using textscan to separate columns by delimiter
First, it would be easier to use *|csvread|*, *|dlmread|*, *|readtable|*, or others. Note that this line overwrites the *|‘...

9 years ago | 0

Answered
How to sort a matrix by row according to another matrix?
I can’t figure out what you want. See if one of these works: A=[1 2 3;3 2 1;4 1 5;1 3 5]; B=[1 2 3;4 1 5;3 2 1]; ...

9 years ago | 1

| accepted

Answered
Error with basic tf function when num and den data are enormous
The problem _most likely_ is that your *|‘num’|* and *|‘den’|* are *_symbolic_* variables. Try this: num = double([nu...

9 years ago | 1

| accepted

Answered
filter matrix according to column
Try this: M = randi([0 1], 10, 60); % Create Matrix M(5, 55:60) = ones(1,6); ...

9 years ago | 2

| accepted

Answered
Solving and Plotting Initial Value Response using EXPM() function
Try this: time = [0:0.01:10]; A = [0 1 ; -5 -2]; B = [0;1]; x_naut = [1;-1]; for k1 = 1:numel(time) ...

9 years ago | 0

Answered
How to use lsim() function for solving and plotting Initial Value Response
To use *|lsim|*, you would have to configure your system with state feedback using the <https://www.mathworks.com/help/control/r...

9 years ago | 1

| accepted

Answered
Extract a certain frequency from the signal
There are several options, all involving filtering the *|0.1611|* Hz frequency out of your signal. A good place to start is...

9 years ago | 0

Answered
How to create function
MATLAB is case-sensitive. Use *|function|*, not *|Function|*. This works: function y=lf(x) y = log(1-exp(-1./x))...

9 years ago | 2

Answered
why do I have this error in index
You didn’t say what the error is, although I am _guessing_ that it is *|‘Undefined function or variable 'p'.’|*. Note that ...

9 years ago | 0

Load more