Beantwortet
Bug in matlab R2012b version
The reality, Scarzo, is that because matlab's 'double' uses a binary number representation, it can never represent any of the fr...

fast 12 Jahre vor | 2

Beantwortet
MATLAB SUMMATION HELP Please????
I notice on your other thread at Answers #142842 you have written: n = 0:201 x = [-50:0.5:50] xs = sum((x.^n./facto...

fast 12 Jahre vor | 1

Beantwortet
Why doesnt e1 converges to zero
Eigenvectors are not uniquely determined even if normalized. For real-valued vectors they may be either of two opposite directi...

fast 12 Jahre vor | 1

Beantwortet
Is there any way that I can optimise this code. It takes lot of time to run and for larger iteration like 'nc=10e6' its stops stating runtime error.
The use of 'symsum' repeatedly in your while-loop could be slowing you down. After all, what you have there is a geometric seri...

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
Optimization problem: solve for the size of negative price shock within a stochastic simulation
It is not necessary to run a simulation to solve this problem. Because the mean value of 'randn' is zero, after each month the ...

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
Calculaing the table of values for function defined as an infinie series
Also you can use this: E = sum(bsxfun(@power,1:10,(0:50)'),1);

fast 12 Jahre vor | 3

Beantwortet
Find points on an ellipse in the xy-plane given the quadratic equation using symbolic variables.
Diederik, it is not clear what you mean by "find points on an ellipse", since there are infinitely many such points. Presumably...

fast 12 Jahre vor | 2

| akzeptiert

Beantwortet
how to plot 3D curves with for loop
In the 'for' command you write: for v=0:1:20 which means that on each trip through the loop 'v' will be a scalar quantit...

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
How can I convert a negative definite matrix into positive definite matrix?
The modified Newton's method attempts to find points where the gradient of a function is zero. If the Hessian at such a point i...

fast 12 Jahre vor | 3

| akzeptiert

Beantwortet
Substitution in Matlab (Iteration Process)
Since your four equations are to be iterative, we can also write a shifted version of the second equation which we can consider ...

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
Vector components along another one
In the line par(i,j) = norm(costh*line); it should be par(i,j) = costh*norm(line); to allow the inward and out...

fast 12 Jahre vor | 0

| akzeptiert

Beantwortet
matrix or array composed by zero-values
If M is the matrix or array, do: all(M(:)==0)

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
If else if statement problem
There is more than one thing amiss in this piece of code. Probably the problem you have in mind is caused by your 'if' statemen...

fast 12 Jahre vor | 1

Beantwortet
If a=[1 2 3], b=[10 20 30], how to create c=[10 20 20 30 30 30]?
Another way: t = accumarray(cumsum([1,a]).',1); c = b(cumsum(t(1:end-1)));

fast 12 Jahre vor | 2

Beantwortet
Substitution Iteration in Matlab
Here is an alternative method of solving your problem. For the fibonacci iteration, x(i) = x(i-1) + x(i-2), we can solve the qu...

fast 12 Jahre vor | 1

Beantwortet
Exploiting symmetry in multidimensional arrays
For a general m-dimensional n^m array, A, do this: [I1,I2,...,Im] = ndgrid(1:n); P = [I1(:),I2(:),...,Im(:)]; Q = sort(P...

fast 12 Jahre vor | 0

| akzeptiert

Beantwortet
Exploiting symmetry in multidimensional arrays
For a 2D array it's easy: B = tril(A,-1) A = B+B.'+diag(A);

fast 12 Jahre vor | 0

Beantwortet
Evaluate elementary symmetric polynomials
Let v = [x_1,x_2,x_3,...,x_n] be a vector of the values of x_i. e = sum(prod(nchoosek(v,k),2));

fast 12 Jahre vor | 3

| akzeptiert

Beantwortet
How do I avoid Infinite loop?
Your use of the while loop is inappropriate for the problem you are dealing with. You stated, "The 'AxIF' is to be updated with...

fast 12 Jahre vor | 0

Beantwortet
calculate mean af cell
If your "cell" is an ordinary 'double' 30 x 39 array, A, do this: B = [mean(A(1:10,:),1);mean(A(11:20,:),1);mean(A(21:30,:)...

fast 12 Jahre vor | 1

Beantwortet
Code of Iterative method's test
It looks as though you might be testing to see if the square matrix, R, fails to be "diagonally dominant". If so, here is a met...

fast 12 Jahre vor | 1

Beantwortet
How to apply OR operation to a matrix?
Your example is not the 'OR', it is the 'AND', of the columns. The 'OR' of the columns is done this way: b = any(a,1); T...

fast 12 Jahre vor | 2

| akzeptiert

Beantwortet
How to find the (x,y) coordinate of an intersection value
If you don't need the intersections of the circles, there is an easier way to find the intersection of the chords. Call the cen...

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
Classification of a matrix to 0 and 1 matrix
Assuming A and B are numerical arrays arranged as shown in your diagram, B = accumarray([2*A(:,2)+A(:,3)-2,A(:,1)],1,[2*ma...

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
how to sort a matrix based on a specific value and bring the row at the beginning of the file
If you put that data in a single matrix M, the 'sortrows' function will do what you want: M = sortrows(M,3);

fast 12 Jahre vor | 2

Beantwortet
Are there speedier alternatives to the mode function?
You could attempt to take advantage of the fact that elements in 'poss' are positive integers and can be used as indices. Howev...

fast 12 Jahre vor | 3

| akzeptiert

Beantwortet
How do I solve "too many input arguments" error ?
It is easy to express this solution in terms of a quartic equation in sin(delta) which could give you as many as four possible s...

fast 12 Jahre vor | 1

Beantwortet
Matrix padding with logical index
In case it is of interest to you, the following code does not depend on placing NaNs in the first array. It uses the 1's in the...

fast 12 Jahre vor | 2

Beantwortet
How to do Subtraction on sets?
You might consult these sites: http://www.mathworks.com/matlabcentral/fileexchange/31753-range-intersection http://www.m...

fast 12 Jahre vor | 1

Beantwortet
Help Plot Complex Equation
One possibility is to superimpose two plots using matlab's 'plot' function. One of these would be the real part of f along the ...

fast 12 Jahre vor | 1

Mehr laden