Beantwortet
Calculate angles between two intersecting lines using the slopes
That formula comes from the trigonometric identity tan(A-B) = (tan(A)-tan(B))/(1+tan(A)*tan(B)) Note: You have the sign...

fast 12 Jahre vor | 0

| akzeptiert

Beantwortet
Mutual array between matrixes ( complete )
Christopher is right. The function you need is 'setdiff' using the 'stable' option. n = length(x1); y1 = x1((c1+1):c2); ...

fast 12 Jahre vor | 0

Beantwortet
find values for the equation of a circle
a = 2; b = 2; r = 2; A = [1 2;1 3;2 4]; B = A((A(:,1)-a).^2+(A(:,2)-b).^2==r^2,:); B contains the coordinate pairs, if a...

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
Random Sorting within a set of columns
The following code is a bit awkward and could be slow for a 1000000 x 4 matrix, but if you are taking three weeks to use it, I d...

fast 12 Jahre vor | 0

| akzeptiert

Beantwortet
error warning "Explicit solution could not be found"
If you were to multiply each equation by the respective values 'a', 'b', etc. these would be a set of homogeneous linear equatio...

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
Help vectorizing 2 For loops with meshgrid and subscripts
[Xm,Ym] = meshgrid(1:a,1:a); [X1,X2] = meshgrid(Xm(:),Xm(:)); [Y1,Y2] = meshgrid(Ym(:),Ym(:)); mat = (X1-X2).^2+(Y1-Y2).^...

fast 12 Jahre vor | 0

Beantwortet
Convergence of Laguerre Function
Hamdi, Your trouble is entirely due to round-off errors whose effect becomes large for large order Laguerre polynomials, togethe...

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
Use eigendecomposition to compute number in modified Fibonacci sequence
First, you can convert the recursion to y_(k+1) = y_k + y_(k-1) where y_k = x_k - 4. Then you can write [y_(k+2);y_(...

fast 12 Jahre vor | 2

Beantwortet
Integration in Matlab from negative to positive infinity
The equal sign "=" is what matlab is complaining about. Read the documentation and you will see no equal sign in the required c...

fast 12 Jahre vor | 1

Beantwortet
numerical double integration symbolically and numerically
The part of what you propose, R yan, that is not certain of success is whether matlab can succeed in finding a symbolic expressi...

fast 12 Jahre vor | 1

Beantwortet
Polynomial arrays intersection and area within intersection
@Rick. What Ahmet has given you _does_ in fact help. Your mistake lies in assuming powers for matlab's 'intersect' function th...

fast 12 Jahre vor | 3

| akzeptiert

Beantwortet
creating matrix by iteration 2
A = floor((15:8:47)'/10);

fast 12 Jahre vor | 1

Beantwortet
How to Convert vector elements to zero for certain N length when its values gets negative?
I think I understand you now. How about this: n = length(F); for k = 1:n if F(k) < 0 F(k:min(k+N-1,n)) = 0; ...

fast 12 Jahre vor | 0

Beantwortet
How to Convert vector elements to zero for certain N length when its values gets negative?
I am not sure what you mean in your remark "till N (lets N=8)". Do you mean that a maximum of N successive negative values in F...

fast 12 Jahre vor | 0

Beantwortet
parameter for geting similar permutation?
The easiest way to accomplish that would be to use 'randperm' to produce a random permutation, p, of the sequence 1:length(k1) a...

fast 12 Jahre vor | 1

Beantwortet
How can I count the values with the threshold value in a vector in MATLAB?
It would not be easy to perform your task with vectorized code, so here is code using a for-loop. Let v1 be the indicated row v...

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
How to perform L2 normalization?
If v is the vector do: v = v/norm(v); (The 'norm' function gives L2 norm as a default.)

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
Solving for a function, quite confounding
Though you haven't said so, I assume that R, c, k, and T are also constants. I also assume that since a_nu as you defined it do...

fast 12 Jahre vor | 1

Beantwortet
I am trying to plot this function dxdt=N0*sin(omega*t)*x*(1-x/K) to get a 3-D plot but my code does not work,where is the error?
It is not necessary to call on 'ode45' to solve this particular differential equation. By ordinary methods of calculus, integra...

fast 12 Jahre vor | 0

| akzeptiert

Beantwortet
Strange graph artifact when performing diff() of a high order
For the higher derivatives you need to increase the size of h which means decrease the number of points, I. There has to be a b...

fast 12 Jahre vor | 1

Beantwortet
how many number of values when added becomes equal to B(Known value)
Assume 'a' is a row vector. x = 1:size(a,2); X = x(cumsum(x.*a)>=B);

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
How to avoid rounding off errors in parametrization?
First you need to get to translate to get rid of the D*x and E*y terms which I assume you have already done, which brings you to...

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
Plotting a complex number.
I suggest you use 'plot3' with the frequency along one of the axes and the real and imaginary parts of your matrix along the oth...

fast 12 Jahre vor | 1

Beantwortet
how to find different permutations of columns of a matrix such that at any permutation just two columns change place
c = nchoosek(1:n,2); p = repmat(1:n,size(c,1),1); for k = 1:size(c,1) p(k,c(k,:)) = p(k,c(k,[2,1]); end Each row of...

fast 12 Jahre vor | 1

Beantwortet
how to compair two vectors element wise and exchange the biger element with the small elements of two vectors
X = sort([B;A],1); B = X(1,:); A = X(2,:);

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
How can i call the value of another variable defined or solved above for solving another equation?
Instead of using 'solve' try using 'roots' for numerical solutions. It will be much faster. Also, 'solve' will in general be...

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
What is the fastest way to list all positive integer vectors whose sum of elements equals K.
K = 20; % The required sum n = 5; % The number of elements in the rows c = nchoosek(2:K,n-1); m = size(c,1); ...

fast 12 Jahre vor | 2

| akzeptiert

Beantwortet
MSE between a set of data points (x,y) and a defined line
Before you carry out your integration it is necessary to establish the y-values for your ideal straight line at the correspondin...

fast 12 Jahre vor | 1

Beantwortet
How to solve simultaneous trigonometric equation with summation from n=1 to inf. ?
I think you will find that if x satisfies the inequalities 0<x<1, your infinite series will in fact be convergent. Otherwise th...

fast 12 Jahre vor | 1

| akzeptiert

Beantwortet
Computing the Inverse of Co-variance Matrix results in "Inf". What could be the problem?
It is inherent in the definition of the Mahalanobis distance of a set of observations from a group of sets of observations, that...

fast 12 Jahre vor | 1

| akzeptiert

Mehr laden