Beantwortet
Rolling sphere along two lines in 3D plane
You have said " *I have two lines in xyz plane.* " This appears to state that the two lines lie in some common plane. With thi...

mehr als 11 Jahre vor | 2

Beantwortet
Remove slices of 3D matrix
That is because after removing the first "slice", slice number 2 becomes number 1 and when you attempt to remove slice 2 it is a...

mehr als 11 Jahre vor | 3

| akzeptiert

Beantwortet
Align Z axis so it is always perpendicular
Set its third component to zero: f1(3) = 0; Of course that shortens the vector. If you want to preserve its vector len...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
How to find indices of elements but keep the order unchanged?
[tf,loc] = ismember(ch_names,pickCh); [~,p] = sort(loc(tf)); idx = find(tf); idx = idx(p); (This assumes this ...

mehr als 11 Jahre vor | 4

| akzeptiert

Beantwortet
help for vectorization coding for multiplication and addition matrixs
Try this: Fn = cost.*W+(W>0).*FC; and W = sum(reshape(outp(:,1:n*dr,u),[],n,dr),3); (I assume u is a scalar in...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
how to scramble positions of a matrix?
Just use the inverses of X and Y: X2 = zeros(1,4); X2(X) = 1:4; Y2 = zeros(1,4); Y2(Y) = 1:4; A2 = B(X2,Y2);

mehr als 11 Jahre vor | 3

| akzeptiert

Beantwortet
Guru's needed - 3-D plotting
Normally plotting of 3D surfaces is done using 'surf' but it requires a grid-type array arrangement of the parameters, which you...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
Need help for vectorization?
In your Aug. 20 Answers #151724 article "Please help me to modify the following program" I showed how you could replace all your...

mehr als 11 Jahre vor | 1

Beantwortet
How do i formulate the following equation function in matlab?
You are missing four multiplication symbols, one parenthesis, and three dots on each equation. The first one should be: Ax...

mehr als 11 Jahre vor | 1

Beantwortet
Parametric Intersection point calculation of two curves
Now that you've corrected your equations, they do have a solution - in fact seven solutions. These can be derived from the root...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
Attempted to access y(15); index must be a positive integer or logical.
If you do a high accuracy check on what you think is an i-value of 15, you will find that it is off from the exact integer 15 by...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
How to know if my data is randomly generated?
You have asked whether your source of the ten possible digits is random. Obviously if you are getting many different results, t...

mehr als 11 Jahre vor | 2

Beantwortet
error message: Form of equation?
If t is an array, then to use matrix multiplication "*" the number of columns in exp((-1/2)*t) needs to be the same as the numbe...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
Number greater than the largest positive floating-point number (1.7977e+308)
In case it is of interest, here is an alternate method of computation based on Pascal triangle summations. m = 25; L =...

mehr als 11 Jahre vor | 2

Beantwortet
Solving a large equation
You can use 'roots'. For each value of x you can compute the corresponding value of each of the four coefficients of the powers...

mehr als 11 Jahre vor | 1

Beantwortet
Number greater than the largest positive floating-point number (1.7977e+308)
There is a much more satisfactory way to compute that expression: round(prod((L+1:L+m)./(1:m))) or round(prod((m+...

mehr als 11 Jahre vor | 3

| akzeptiert

Beantwortet
what called this method of generation random sample
In the code you show, Mutah, strictly speaking the y vector is not a pdf - a probability distribution function. It is a pmf - a...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
If there is a group of n people in a room, what is the probability that two or more of them have the same birthday?
The probability, P, (in a non-leap year) is: P = 1 - prod((365:-1:365-n+1)./repmat(365,1,n));

mehr als 11 Jahre vor | 1

Beantwortet
Looping for finding dominating points.
Mohammed Rizvi, in a forum of this nature you really ought to carefully define a concept such as "dominating points" so as to av...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
How to check this condition? (matlab programming)
The following code assumes there are at least 20 such pairs. If not, you will have to regenerate a and b and start over again. ...

mehr als 11 Jahre vor | 2

Beantwortet
How to covert a vector of lower triangular matrix factors back to the original matrix?
I assume we have n where the desired matrix is to be of size n x n and the vector v which must be of length n*(n+1)/2. A =...

mehr als 11 Jahre vor | 1

Beantwortet
solving a non-linear problem
With some mental effort I was able to reduce your new set of equations to a single variable, but this variable is x7, not x4. Y...

mehr als 11 Jahre vor | 2

Beantwortet
To calculate the angles of the Delaunay triangles
If P1, P2, and P3 are coordinates of the three vertices of a triangle, and A is its area, its angle at P1 can be calculated as: ...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
Uniformly distributed pseudo-random numbers
To do what you ask would require the result vector to have 145, not 144, elements, unless the vector is considered circular with...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
Need help implementing a recurrence relation
If I interpret your initialization statement correctly, you have Y(a,b,0,0) = 1 for every non-negative integers a and b. ...

mehr als 11 Jahre vor | 1

Beantwortet
How can I index a multidimensional array with another multidimensional array containing indices into one of the dimensions of the first array?
[n1,n2,n3,n4] = size(I); I2 = repmat(size(A,1)*(0:n2*n3*n4-1),n1,1); B = reshape(A(I(:)+I2(:)),size(I));

mehr als 11 Jahre vor | 3

| akzeptiert

Beantwortet
MATLAB plotting question, please help
You need to put a dot on the division symbol: y=(exp(t/10).*sin(t))./(t.^2+1);

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
Solving an implicit equation involving complex numbers
If you can express each of the four coefficients of your polynomial as functions of x, I would recommend using matlab's 'roots' ...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
Problem with while loop, index is set back
It is not clear whether at the second '1' in vector1 of your example the '1' that is put into 'u' is copied immediately from vec...

fast 12 Jahre vor | 3

| akzeptiert

Beantwortet
what does c(:).' mean? c should be a vector
This is a short way to reshape c, whether it is a vector or array, into a row vector. You are then guaranteed that obj.coef wil...

fast 12 Jahre vor | 2

Mehr laden