Answered
'Subscript indices must either be real positive integers or logicals' on calculating rank(A) of a numeric matrix.
Don't define a variable named rank, certainly not if you ever intend to use the FUNCTION named rank. This is why you get the sub...

8 years ago | 1

| accepted

Answered
Get the resultant matrix from the operation z[n] = x[2n]
You need to learn the basic tools of MATLAB, for example, how to index. What is x(2:2:end)? What would happen if you assig...

8 years ago | 0

Answered
Plot Natural Cubic Spline
You were close, in that csape can do it. (My SLM toolbox also has a natural cubic as an option, but there is no need to go that ...

8 years ago | 2

| accepted

Answered
How do I find the Dominant Eigenvector of a 64x64 Hollow Matrix?
You misunderstand eig, and what it returns. In turn, that means you need to read the documentation. A classic hollow matrix h...

8 years ago | 0

Answered
Calculation speed/time changes for same operation
It definitely is a memory issue. Simplest is to get more memory, which is relatively cheap. If the array is always the same s...

8 years ago | 0

| accepted

Answered
Failure to solve symbolic equations in the form 'A*sin(x) + B*cos(x) == C'
I would point out that for SOME values (ok, many) of {a,b,c}, there is no real solution. So if you specify that all are real, in...

8 years ago | 0

| accepted

Answered
Second Order Linear Homogeneous Differential Equations with non initial conditions.
Easy peasy. :) Ok. I'll admit it may not be obvious unless you think about it from the right point of view. The trivial solut...

8 years ago | 2

| accepted

Answered
Squaring a sparse upper-triangular matrix results in more non-zero elements than its original self??
Why do you think the matrix should be more sparse after squaring? Exactly the opposite should be the case, due to fill-in, a...

8 years ago | 0

| accepted

Answered
How to multiply the following matrices?
If you are trying to solve the problem Q*I = V then the solution is: I = Q\V I = -0.121588722044901 ...

8 years ago | 0

| accepted

Answered
exponential fit base 10
We don't see your data. Nor do we see the results of the fit. However the chances are very good that what you have are poor star...

8 years ago | 0

| accepted

Answered
using mod function for checking integers
Why not play with mod? See what it does? Lets see what we can do. K = 1:10; Now, pick some number that we want to use to...

8 years ago | 2

| accepted

Answered
Eig command returning wrong eigenvectors?
Doing wrong? First, it looks like you have format set to rat. [V,D] = eig(K); V V = 0.179605302026751 ...

8 years ago | 0

| accepted

Answered
Different behaviours of char ''.
But why what? When you concatenated an EMPTY character vector to the vector [1 2], MATLAB interpreted that as saying that the...

8 years ago | 0

Answered
Fit given data into given equation and find value of constants
If you are doing any curve fitting, the curve fitting toolbox, the optimization toolbox, or the stats toolbox will all prove use...

8 years ago | 2

| accepted

Answered
How to make my code run faster?
Well, you DID write code that does what you wanted. However, it employs a terribly poor choice of method to achieve your goal. T...

8 years ago | 4

| accepted

Answered
What function to be use in place of randn() function ?
Be serious. You cannot generate a non-integer NUMBER of random numbers. Mb = (M/K); Nb = (N/K); plusminus1 = sign...

8 years ago | 1

Answered
Curve smoother that holds resulting curve a max distance from original data?
Short answer: No, there is not. at least not that I know of. There is nothing provided with MATLAB, nor have I even provided tha...

8 years ago | 0

Answered
How to fit data to data
ab = polyfit(G,F,1); ab ab = 10 1 So a is 10, b is 1. a = ab(1); b = ab(2); The s...

8 years ago | 0

Answered
How to store all the T values from this nested loop?
Assuming that you wanted to sum over the values of n (which is the only thing that seems to make sense here) In an older rele...

8 years ago | 0

| accepted

Answered
Time constant of exponential decay
As Walter pointed out, you don't have a purely exponential model. Yet, this is way easier than you think to solve. Two lines of ...

8 years ago | 2

Answered
Solving a system of 5 dependent non-linear equations
Maybe you THINK you know where the solution lies. But if you are correct, you will essentially NEVER be able to solve this probl...

8 years ago | 0

Answered
What iteration method to use?
Why would you do this using a loop? You want to solve for the value of y, such that the value of f(y)-x_target=0 Read th...

8 years ago | 0

| accepted

Answered
I have a nonlinear equation ,, which i didn't know how to put it in matlab
You responded to my question without explaining what E(T) has to do with anything. So is it clear? Not fully. It seems you ha...

8 years ago | 0

Answered
solving conic equation for a set of points
Be careful in how you try to solve this. Tools like fsolve will NOT be correct. In fact, fsolve will converge to the all zero so...

8 years ago | 0

| accepted

Answered
How to smooth using Savitzky-Golay Filtering
Why not look on the file exchange? There are multiple tools there that claim to do Savitsky-Golay. Even better, is to read th...

8 years ago | 0

Answered
How to learn MATLAB
My own take on learning MATLAB is to use it. Play with it. Try things out. If you don't know how something works, then read the ...

8 years ago | 2

Answered
How to create a counter variable in a loop
Why do you need a loop at all? Why not look for tools that will solve your problem. accumarray is one such tool. Actually, I can...

8 years ago | 1

Answered
How to create a symbolic matrix which is symmetric?
A = sym('A', [6,6]); A = tril(A,0) + tril(A,-1).' A = [ A1_1, A2_1, A3_1, A4_1, A5_1, A6_1] [ A2_1, A2_2, A3_2, ...

8 years ago | 4

| accepted

Answered
Algorithm for a moving irregular time window?
The "algorithm"? type movmean 'movmean' is a built-in function. So movmean is a compiled function. It uses a loop, s...

8 years ago | 0

Answered
why doubling is done from 2 to end-1 only in plotting single sided spectrum: P1(2:end-1) = 2*P1(2:end-1); ?
end (when used as a subscript) is a shorthand to indicate the last position for the corresponding index. So V(end) refers to ...

8 years ago | 1

| accepted

Load more