Answered
Sparse Matrix Factorization Problem
So you want to solve the problem A*X*B == C Subject to minimizing an L_0 norm on X? You have stated that A and B are ...

10 years ago | 0

Answered
Calculate Hjorth parameters with Matlab or EEGLAB
When you use diff on a vector, you are NOT differentiating a function. Only you know where those numbers came from. diff compute...

10 years ago | 0

Answered
How to fit multiple lines over sets of datapoints.
You want to fit a function that is NOT a function, and is certainly not a smooth function. After the bifurcation occurs, the ...

10 years ago | 0

Answered
Interp function error with my curve
There is no simple polynomial that interpolates that curve. It clearly has a singularity at zero. The last time I checked, polyn...

10 years ago | 0

Answered
Noise samples of gaussian mixture distribution
Ok, so you have formulated what seems to me to be a rather strange mixture model. You have two modes, with variances that are...

10 years ago | 2

| accepted

Answered
How do I convert the dimesion of a matrix from 1 m n to m n?
This will not change the order the elements are stored in memory. So either reshape, or squeeze will suffice. In fact, it could ...

10 years ago | 1

Answered
where i can find source code of "detectPeopleACF"
If detectPeopleACF is an m-file, then you can just use type detectPeopleACF at the command line to view the code. Typ...

10 years ago | 0

| accepted

Answered
Why rand function is not uniform in large intervals?
Sigh. I think this is a misunderstanding of what uniformly random means. A fairly common one too. Since you seem not interested ...

10 years ago | 5

| accepted

Answered
Solve returs a empty syms
So you have an fairly complicated set of equations (12 of them) in many variables (also 12). An empty return says that no sol...

10 years ago | 0

Answered
roots of a complicated function
Use fzero. Or solve. Or roots. Or vpasolve. Or fsolve. ... Much depends on the function. How many variables? Is it in symboli...

10 years ago | 1

Answered
Problem with matrix composed of numbers and strings
Matrices cannot be composed of a combination of character and numeric information. They must be character, or they must be numer...

10 years ago | 1

| accepted

Answered
Crazy, malformatted numbers as answer to simple equation.
Oh, really, it'll cost you a lot of points? To turn in a mathematically correct answer? When you type in a number like 2e-6, ...

10 years ago | 1

| accepted

Answered
Derivative of a gridded interpolant
Nothing stops you from using spline instead directly, and there are no apparent plans for spline to ever go away. That would be ...

10 years ago | 0

Answered
Looking to learn MATLAB. Any advice as to a good book?
The funny thing is everyone learns differently. For me, the best way to learn is by doing. So would suggest that you pick some p...

10 years ago | 1

Answered
How to erase the diagonal elements of a matrix (in one line)?
No. You did NOT try that. because that is invalid MATLAB syntax. See the difference between the following two lines: A[1:N+...

10 years ago | 0

Answered
Given a positive number , how to determine its surrounding integers
What would ceil(x) and floor(x) tell you? Or for that matter, what would floor(x)+1 be? You need to decide i...

10 years ago | 1

| accepted

Answered
Matrix element deletion for elements greater than an integer
T(T>Tmax) = NaN;

10 years ago | 0

| accepted

Answered
"Exist" return 0 for a file it displays when using "ls"
The "." characters in the middle of your .mat file name probably cause exist to fail. This is generally a bad idea. A "." charac...

10 years ago | 0

Answered
How do I find values that make up a desired linear combination of vectors?
Of course, there is no reason to know that any value of x and y actually exist that will satisfy the requirement. And even if yo...

10 years ago | 2

Answered
How to simplify matrix expression
Will one line suffice? y = sparse((1:5000)',reshape(repmat([10,1:9]',1,500)',[5000,1]),1,5000,10);

10 years ago | 0

Answered
How to account for time-varying universe in portfolio optimization?
Why not use a binary vector? 0 if the company is not in your current portfolio. 1 if it is. Of course, now you will need to use ...

10 years ago | 0

| accepted

Answered
fzero runs out of iterations
It is claimed to be a polynomial. Use roots! By the way, fzero will be far more robust than fsolve, because you should be sup...

10 years ago | 0

Answered
How to check which function is the slowest one?
Use the profile tool to identify bottlenecks. help profile

10 years ago | 0

Answered
How can I condense this into one linear constraint?
You cannot condense TWO distinct linear constraints into ONE linear constraint, where the distinction is based on another linear...

10 years ago | 0

| accepted

Answered
Calculate the vector y by solving the system: cmat*y = −Eta*K*X− 1(1 − Eta)yin*v.
Why should we need to read your paper? y = cmat\(−Eta*K*X− 1 ? (1 − Eta) ? yin*v); I've written the relation for y. HO...

10 years ago | 0

Answered
What is the fastest way to solve a large linear system in matlab? Is it faster than writing my own solver in C#?
Yes. MATLAB will generally be faster than home-grown code, and probably more stable too. Of course, it depends on what you know,...

10 years ago | 0

| accepted

Answered
Generating a random number inside a function decleration
This will cause ODE45 (or any such adaptive solver) to work terribly. Essentially, it will see the random component of your f...

10 years ago | 0

Answered
"medianfiltermex" ???
Sorry. All .mex files provided with MATLAB do not have the source code provided.

10 years ago | 0

| accepted

Answered
How to find line of code that prints ans
The others have shown the classic ways to find an unterminated line, although it is still possible for them to fail if you were ...

10 years ago | 2

Load more