Answered
Difference between poissrnd and discrete random number (round(rand(1))).
The two random generators give vastly different results, Murali. The call round(rand) can only give 0 and 1 values which are eq...

12 years ago | 0

Answered
How do I create such matrix ? (please look at the thread for further details)
In case it is of interest to you, Derick, here is an explicit formula for individual elements of your vector X in terms of its f...

12 years ago | 0

Answered
i need m-file to convert decimal to hexadecimal without using the built in command deci2hex
I won't give you an m-file, but here's an outline of how to proceed, Malek. If you are dealing with positive integers, do a mod...

12 years ago | 0

Answered
How can I solve the following summation?
That's a convergent series, Kei Hin, but it would be a lot easier to evaluate sqrt(.5)*sinh(sqrt(.5)) which gives the same value...

12 years ago | 0

Answered
Please help with this
I will give you one more hint on your problem, Victor. The part of the problem statement that says " *according to the dimensio...

12 years ago | 0

Answered
Insertion of the index
Here's a way using two nested for-loops: K = zeros(n*(n-1),n); r = 0; for i1 = 1:n p = [1:i1-1,i1+1:n]; for...

12 years ago | 0

| accepted

Answered
i need to transfer matrix coordinates in a specific order
It's not clear to me what form you wish the two new matrices to have. The following is just my guess. Perhaps if you give conc...

12 years ago | 0

Answered
Dealing with Subscript Error
Matlab won't let you use zero as an index value. You need to create an index variable that indexes values of x. Do this: N...

12 years ago | 0

| accepted

Answered
How can I determine the mean value every 10 data points and then calculate the standard deviation of the mean values (150)?
I'll put it in words. Rearrange the data using 'reshape' and perhaps transpose so that the groups of ten are in columns (or els...

12 years ago | 0

Answered
Indexing problem in a script ("for" loop)
You are apparently allowing permutations with repetitions. If so, there will be a total of k^(d-1) of them. You can use 'dec2b...

12 years ago | 0

| accepted

Answered
Find angle between dots
The matlab function 'atan2' can be used to accomplish this. It is more accurate for this purpose than 'acos'. Let P0 = [x0;y0]...

12 years ago | 1

Answered
Need help creating a function m-file for the bisection method for the following equation...
I recommend you carefully read the Wikipedia article at: http://en.wikipedia.org/wiki/Bisection_method The method requir...

12 years ago | 1

| accepted

Answered
Cosine distance range interpretation
Your statement, "Since Matlab uses 1-(cosine), then 1 would be the highest variability while 0 would be the lowest", is not true...

12 years ago | 0

| accepted

Answered
The value of ksdensity great than 1
There is nothing wrong with a probability density being greater than one. A probability cannot be greater than one, but a proba...

12 years ago | 0

| accepted

Answered
Generating integer random numbers from power-law distribution
The distribution you mention is equivalent to the zeta distribution with alpha+1 replaced by s. See the website http://en.w...

12 years ago | 0

Answered
How to fit this eqation:y=a-b+*c^x ?
Instead of 'a-b*c^x' you might try the equivalent 'a-b*exp(k*x)'. If you can fit to that, then c = exp(k) will be a fit for 'a-...

12 years ago | 1

Answered
Reconstruct 2D array from single values
After doing an appropriate reshape, do a transpose to achieve that result: reshape([1 2 3 4 5 6 7 8],4,2).' (= [1,2,3,4 ...

12 years ago | 0

Answered
Solve function. Warning: Explicit solution could not be found.
In the equation Dist(i)^2 == (ucTemp-ug)^2+(vcTemp-vg)^2 when the right side of the equation vcTemp == -0.1209*ucTemp...

12 years ago | 0

Answered
How to assign probability to a matrix element?
It isn't clear whether the elements' probabilities are all to be equal to a single value, p, or each element A(i,j) is to have i...

12 years ago | 0

Answered
What is the reverse function of dmperm()?
As long as you use the single-output version of 'dmperm' p = dmperm(A); and only permute the rows of matrix A, getting A(...

12 years ago | 0

| accepted

Answered
How to write a code for "N points on a Fibonacci spiral placed within the circle"?
I have checked out the 'circle_grid_fibonacci' function on the web site you referenced (although the link you gave had a mistake...

12 years ago | 0

| accepted

Answered
Not enough input arguments?
You have used the name 'length' for one of your variables, but that is also the name of one of matlab's functions. Where it com...

12 years ago | 1

Answered
polynomial division issue, how to find the remainder
If your field is that of the real numbers, look at 'deconv' function at: http://www.mathworks.com/help/matlab/ref/deconv.htm...

12 years ago | 0

| accepted

Answered
mldivide returns matrix with multiple rows = 0 when they should not be
Lauren, your equations are highly underdetermined. Given the sizes of A and B, you necessarily have six equations and twenty-fo...

12 years ago | 0

Answered
How to minimize a sum of squares?
If one temporarily ignores the constraint that v be a non-negative integer, this is a linear least squares problem in disguise a...

12 years ago | 1

Answered
i have the problem with mean function
If the number of rows in c and X are not the same, matlab will complain.

12 years ago | 0

Answered
How to find position of something
You can use the 'find' and 'diff' functions as well as 'isnan' to accomplish that. Let A be your column vector of elements with...

12 years ago | 1

| accepted

Answered
loop to create the new matrix which contains the kron product
K = zeros(3*3,3*3); for i=1:3 for ii=1:3 K(3*i-2:3*i,3*ii-2:3*ii) = A(i,ii)*B; end end

12 years ago | 0

| accepted

Answered
Taking derivative of a time based function?
The 'diff' function serves two purposes, one to take derivatives and the other to take finite differences. To make it take deri...

12 years ago | 0

Load more