Answered
What code would you input to represent the equation for the volume of a sphere without getting an undefined variable error?
Easy, peasy. V=(4*pi*r.^3)/3; I added a semi-colon at the end, and I used .^ for the exponent, in case r is an array or ...

10 years ago | 0

| accepted

Answered
What is the time complexity of the function unifrnd(varMin,varMax,varSize)
No. This does NOT generate a vector. It generates a 5x5 array as you have specified the call. (If you don't believe me, try it! ...

10 years ago | 0

Answered
N-D "Online" convex hull
The simple solution makes sense. 1. Compute the convex hull of all points, using convhulln. 2. Drop all points that are NO...

10 years ago | 0

| accepted

Answered
How to Solve an equation using if statements?
Has nobody ever answered this? So sqrt(2014) ans = 44.878 nthroot(2014,4) ans = 6.6991 A ...

10 years ago | 1

| accepted

Answered
any alternative function to speed up the interpolation process? because interp1 is very slow?
The crystal ball is so foggy. 1. We have no idea how much data you have. Big problems take longer to solve. Sometimes you jus...

10 years ago | 1

| accepted

Answered
I'm having trouble running my script
Of course, this is not even close to valid MATLAB syntax, with errors in perhaps half of the line of your code. I think it is...

10 years ago | 0

Answered
I have a data matrix of size 890*9 , now I want to find out the correlation coefficient matrix, So I use the corrcoef command and get a 9*9 matrix. But the problem is I get a 9*9 matrix which is full of NaN. What am I doing wrong
A useful little tool I have for these questions displays some information about your array. data has 890 rows and 9 columns...

10 years ago | 1

| accepted

Answered
How do I ask for a workspace variable input in a running program?
A simple answer is <http://www.mathworks.com/matlabcentral/fileexchange/27106-putvar--uigetvar uigetvar> , posted on the file ex...

10 years ago | 2

| accepted

Answered
Shift Operation, shifting to the right
Do you think that really is the EXACTLY correct answer? Let us look at it more closely. As a double precision number, MATLAB ...

10 years ago | 0

Answered
Newbie: How to write Xn+1 = functions?
I'd normally not answer a basic question. But you did show some thought. A loop is simplest. Yes, there are lots of ways you ...

10 years ago | 1

| accepted

Answered
How can I work with small and large numbers?
Use the symbolic toolbox, or my HPF toolbox. Those are the lazy way to solve most problems of those sort however, and they will ...

10 years ago | 2

Answered
can any one tell me what dose ''x = [441x2 double] '' mean? x is a variable . thanks in advance
This a fairly common typical notation that indicates the size and shape of an array, as well as the datatype. So here, a double ...

10 years ago | 1

Answered
Interpolation when data are not strictly monotonic
OK, the problem is you have a function with different y values for the same x. How can interp1 predict when there are more than ...

10 years ago | 0

Answered
How can I solve the matrix shifting equation with fmincon
I'm afraid you are totally wrong. You are searching for a circular shift. Since the shift must be by an integer amount, it is...

10 years ago | 0

| accepted

Answered
How to make an ellipse with given standard deviations?
help mvnrnd

10 years ago | 0

| accepted

Answered
Robust version of convexhulln ?
You can want convhulln to work as you wish, but wishing won't make it so. Code does as it is designed to do. In this case, it is...

10 years ago | 1

| accepted

Answered
How can I fix this error?
So x is a VECTOR, not a matrix. You need to understand there will NOT be a unique solution. The matrix a is 10 by 11, so the ...

10 years ago | 2

Answered
How can I fit a curve where it turns back
You can use tools like cscvn. Or you can use my <http://www.mathworks.com/matlabcentral/fileexchange/34874-interparc interpar...

10 years ago | 0

| accepted

Answered
How can I see Matlab code (.mat) when we have .m?
Huh? Those are m-files, scripts in this case. You can edit it with any text editor, including the edit command in MATLAB. You ca...

10 years ago | 0

Answered
[x,y,z] = sphere, except uniform or random distributed points
You say that you want it "random" in some sense. But then your comment indicates that you don't want areas where there are no po...

10 years ago | 0

Answered
Optimization Toolbox - Sorted Variables
Linear equality constraints suffice of course. Be careful, that the tolerance constraint will allow SLIGHT constraint violations...

10 years ago | 0

| accepted

Answered
Solve non homogeneous non linear ineqaulity
This is homogeneous, in the sense that (0,0) IS a solution to the equality statement. That you put one term on the right hand si...

10 years ago | 0

Answered
How to add more atoms to FCC structure to look like single unit cell of zincblende
So think about what properties an atom in that structure has, in terms of distance to those other atoms. This is a big part of m...

10 years ago | 1

| accepted

Answered
Is there an error in the function geopdf?
Why is x==0 not possible? Of course it is! 0 is just a number. You can attach any meaning to a number that you wish. It seems qu...

10 years ago | 0

Answered
How can I fit a concave baseline curve to a spectrum?
Um, the red curves as you have dawn them are not in fact convex. :) Anyway, the simple answer is... 1. Using the curve as ...

10 years ago | 2

Answered
pseudorandomize using brute force
Even after the repair, correcting the number of zeros and ones... You have 79 ones, and 316 zeros. The requirement is that a ...

10 years ago | 0

Answered
I want to test whether a real symmetric matrix is singular. What is an appropriate threshold to test whether the smallest singular (eigen) value is zero?
Is this matrix singular? 1e-300*eye(2) The smallest eigenvalue is 1e-300. So is the largest. But the matrix is not at al...

10 years ago | 0

Answered
min() Subscript indices must either be real positive integers or logicals.
Don't define a variable named min. If you do, then you get that exact error when you try to use the FUNCTION named min. IF you d...

10 years ago | 2

Load more