Answered
Am I defining the permutation well?
As it stands, your wish to generate that table using that formula with a matlab array P cannot be realized because its first col...

13 years ago | 0

| accepted

Answered
Am I defining the permutation well?
As I stated earlier, the code I wrote assumed that you wanted only a single number returned by your 'euler' function, namely the...

13 years ago | 0

Answered
Merging or Combining Rows
For your stated purpose you should use 'unique' with the 'rows' option. To answer your question, however, do the following. ...

13 years ago | 1

Answered
Am I defining the permutation well?
Your problem will be greatly simplified if you compute only those Euler numbers actually required in the recursion formula for g...

13 years ago | 0

Answered
Plot a curve with changing slope and given initial and final end points?
As you have posed the problem, no solution with monotone increasing x is possible, because the overall slope between the points ...

13 years ago | 0

Answered
Solve matrix in the equation
You can't use the 'solve' function with vector inputs in that manner. You should leave all six parameters as symbols and let 's...

13 years ago | 0

Answered
How to avoid for loops when generating index arrays?
For your particular problem you can do this: M = (0:n*(n+2))'; L = floor(sqrt(M)); M = M-L.*(L+1); (I've used upperca...

13 years ago | 1

Answered
how to multiply and concatenate at same time?
A method using 'bsxfun': A = [ a b c ; d e f ]; B = [ g h ; i j ]; [m,n] = size(A); C = reshape(bsxfun(@times,reshape(...

13 years ago | 1

Answered
If I have the number of faces and vertices, how do I determine the topology of a filled polygon?
Surely you mean you want the topology of a polyhedron, rather than a "filled polygon". You should be able to directly calcula...

13 years ago | 1

| accepted

Answered
What's wrong with my bisection method function???
In the 'while' condition "((k<=tol)&&((b-a)/2)>= tol)" presumably you have set 'tol' to some very small number to allow a and b ...

13 years ago | 0

Answered
numerical integration with nonarray function
With x used as a vector, your integrand can be written as: (x.^n)*det(A) with the x factored out, which should integrate ...

13 years ago | 0

Answered
how to find the sum terms in of binomial expansion
With that range of r I would think it would be more efficient to compute (q+p)^n-q^n-n*q^(n-1)*p

13 years ago | 0

Answered
Problem When Concatenating 2 Arrays [Help]
The problem is not in the concatention; it is in the display of the results. Apparently all the entries from A that are shown a...

13 years ago | 0

| accepted

Answered
Taylor series with sin(x).... I need help setting up my while loop and error bound
I see three mistakes here. 1. You reference sin_approx(count-1) but you aren't storing sin_approx in an array so there is no ...

13 years ago | 0

Answered
Generating random numbers in order?
If a and b are the lower and upper limits you have in mind for the numbers, do this: x = sort((b-a)*rand(n,1)+a,'ascend' or ...

13 years ago | 5

| accepted

Answered
How to count unique value in array?
f = diff(find([true,diff(a)~=0,true]));

13 years ago | 0

Answered
Solving two trigonometric equations, two unknowns
There is no need for the answer to be that complicated. Here is a method entirely independent of 'solve' and 'fsolve'. R*co...

13 years ago | 0

| accepted

Answered
Infinite or Not-a-Number function value encountered.
As I stated in your similar query in the matlab newsgroup, your trouble occurs because the exponent, hbar*w./(kB*T), becomes exc...

13 years ago | 0

| accepted

Answered
Solving three equations with three unknowns with matlab 2011
I can sketch a method of solving them which doesn't involve the 'solve' function. Divide the second equation by the first one t...

13 years ago | 0

Answered
Conditional cumsum - how to create?
Try this. outp = cumsum([inp(1);min(diff(inp),0)]);

13 years ago | 1

| accepted

Answered
combinations of a matrix.....
If I understand you correctly, your problem is the same whether your M is a matrix or a single vector with the same total number...

13 years ago | 2

| accepted

Answered
Help to solv a equation with iteration
You can solve that equation without doing any iteration, Claus. Using the formula cos(2*A) = 2*cos(A)^2-1 your equation ...

13 years ago | 0

Answered
Solving 3 equations with 3 unknowns
I claim there are either no solutions or infinitely many solutions to your three equations, and I'll tell you why, Hamza. By ma...

13 years ago | 0

Answered
Help with solving two equations set equal to each other
It is important to realize that ordinarily one cannot solve two simultaneous equations with only one unknown. It generally take...

13 years ago | 0

Answered
if statements inside a function file and the function called by a for loop
When you write "y=test(x)" rather than "y=test(x(n))" or "y=test(x(n+!))", you are passing 'test' an x vector with 100 elements ...

13 years ago | 0

Answered
Computing probabilities from joint distribution of functions of random variables
You can use matlab's 'integral3' function with numerical integration taken with respect to y1, y2, and y3. Your limits of integ...

13 years ago | 0

Answered
How to extract the first and last position for each ones series ?
f = find([false,diff(x)~=0,false]); y = [f(1:2:end)',f(2:2:end)'-1];

13 years ago | 0

Answered
How to make my code run faster?
If you ignore the limits you have placed on A and B, and you want to do this minimization without using matlab's optimization fu...

13 years ago | 1

| accepted

Answered
The system of equations (64 equations -12 unknown) solution help
Are you saying the n's are a geometric progression? Why didn't you tell us that at the beginning? This information is essentia...

13 years ago | 0

Answered
How to count numbers considering all consecutives as one??
count = sum([true,diff(data)~=0]);

13 years ago | 0

Load more