Beantwortet
How to interpretate numbers below de MATLAB precision
You may have a misunderstanding of double precision floating point numbers, Fidel. The number 2.2204e-16 is the value of the le...

etwa 11 Jahre vor | 1

Beantwortet
How to create a m by n matrix in which each element be another p by q matrix?
You cannot do that with matrices. Each of their elements must be a single scalar quantity. However, you can do such things usi...

etwa 11 Jahre vor | 2

Beantwortet
Power or Sum first
As it stands, the summation occurs first, followed by taking the square of that sum. You should be able to determine that from ...

etwa 11 Jahre vor | 1

| akzeptiert

Beantwortet
how to input each element (different) of a matrix 'R' in same function 'f' and compute result in the matrix form?
You need dots on the last line: f = (2 * R / (N * b^2)) .* exp(-(R.^2) / (N * b^2))

etwa 11 Jahre vor | 0

Beantwortet
How to compute an associated legendre function given by P(n,a*m/b,x)?
For a non-integer value of the order, I believe the Legendre function can be evaluated using matlab's 'gamma' and 'hypergeom' fu...

etwa 11 Jahre vor | 1

| akzeptiert

Beantwortet
I'm using a for loop to create a new random variable X with range [0 1], I want the forloop to ignore values above 1 and iterate untill all the values are in range.
I am guessing that what you actually want is the following. It will give you 200 values in X which are all less than or equal t...

etwa 11 Jahre vor | 0

Beantwortet
Randomly generated row matrix B with constraints?
I think this is what you want, Laurie, assuming A elements are all non-negative integers. B = floor((A+1).*rand(size(A)));...

etwa 11 Jahre vor | 0

Beantwortet
Randomly generated row matrix B with constraints?
I don't understand what you mean in the sentence "I also need a 0 to be a possible randomly generated number in Matrix B". For ...

etwa 11 Jahre vor | 1

Beantwortet
Fourth order approx. of first derivative.
Your code for 'D' has an error. You have multiplied by 'h' instead of dividing by it. The code should read: D = (1/12./h...

etwa 11 Jahre vor | 1

| akzeptiert

Beantwortet
How can I find the angle between two vectors, including directional information?
If v1 = [x1,y1] and v2 = [x2,y2] are the components of two vectors, then a = atan2d(x1*y2-y1*x2,x1*x2+y1*y2); gives the...

etwa 11 Jahre vor | 13

| akzeptiert

Beantwortet
Finding the elements in two matrices with different sizes?
You can also use 'ismember': C = B(ismember(B,A));

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
Performing integral trapz-error invalid permutation index
Apparently you wish to find the integral of the function 'Fun' with respect to 'Vg'. If so, the line IntNs(t) = trapz(Vg,...

etwa 11 Jahre vor | 0

Beantwortet
Regarding random generation of elements in a matrix.
You stated "at max two ones", Abhinav. If you want to include the cases where there are less than two 1's, you could do it this...

etwa 11 Jahre vor | 0

Beantwortet
eval giving the wrong mathematical answer
In matlab the 'log' function is considered to be the natural logarithm with base e, not 10. Therefore 3.3863 is the correct ans...

etwa 11 Jahre vor | 1

Beantwortet
angle output vs. atan2 output
Yes, they should be the same, provided that X and Y are real numbers or real arrays.

etwa 11 Jahre vor | 1

| akzeptiert

Beantwortet
why, if I have data highly correlated, i obtain Ill-conditioned covariance when i use fitgmdist?
Just suppose that the correlation between each pair is one. Then the correlation matrix would consist of all ones and such a ma...

etwa 11 Jahre vor | 0

Beantwortet
WHY THIS CODE IS SHOWING ERROR ?
The usage of 'input' is invalid. It cannot accept more than two inputs. Moreover it is unable to print out the values of i-1 a...

etwa 11 Jahre vor | 0

Beantwortet
Size information is inconsistent.
In 'trirnd' you must have either three arguments or five, not four. If you want a column vector of 10000 elements, write: ...

etwa 11 Jahre vor | 0

Beantwortet
Finding coefficients of a polynomial from roots
If r1, r2, and r3 are the roots, then a polynomial with those roots is: p(x) = (x-r1)*(x-r2)*(x-r3) = x^3-(r1+r2+r3)*x^2+(r2...

etwa 11 Jahre vor | 0

Beantwortet
solve 3 degree of freedom vibrational problem without using numerical integration like ode solvers
I will give only a partial answer here and leave much of the work to you, Eswar. It is known in the theory of ordinary differ...

etwa 11 Jahre vor | 0

Beantwortet
How can I obtain the derivative of a vector?
You can get an approximation to the derivative of dx1, dx2, and dx3 using matlab's 'gradient' function. If you would prefer a h...

etwa 11 Jahre vor | 1

Beantwortet
Why won't it go through the ifelse statement when the if statement isn't satisfied?
It is highly unlikely that any random element in the second row of A would happen to be exactly equal to the maximum integer of ...

etwa 11 Jahre vor | 1

| akzeptiert

Beantwortet
Trouble with finding the surface area given surface triangles their vertices and the vertices' normals
There should be no need to use 'trapz' in this problem. Just sum the areas of the triangles, making sure that you have the posit...

etwa 11 Jahre vor | 3

| akzeptiert

Beantwortet
Solve Trancedental equation with two dependent variables
Use 'fzero'. It is helpful to first make a plot of the left side of your equation as a function of omega to get an initial omeg...

etwa 11 Jahre vor | 0

Beantwortet
How do I wrap text using the disp or display function?
I suggest using 'fprintf' instead of 'disp'. The "\n" symbol will give a new line.

etwa 11 Jahre vor | 0

Beantwortet
Using an apostrophe with fprintf
Use double apostrophe just as you would in any matlab string: fprintf('Avogadro''s constant is 6.022e+23 molecules/mole.\n...

etwa 11 Jahre vor | 0

Beantwortet
Getting largest to lowest values from a row
Let A be your original matrix. B = [sort(A(2,:),'descend');sort(A(3,:),'ascend')]; B = B(:);

etwa 11 Jahre vor | 1

Beantwortet
What function do I use to generate a matrix with the values in specific increments?
I think you mean something like this: incr = rand(1,n); % Variable increments x = cumsum(incr); % Variable with 'inc...

etwa 11 Jahre vor | 0

Beantwortet
How do I reverse a vector?
x = fliplr(x);

etwa 11 Jahre vor | 1

Beantwortet
Why am i recieving a "parse" error?
You can't write your function that way. Write it this way: function y = trigC(x) y = cos(5*x); end Because of...

mehr als 11 Jahre vor | 3

| akzeptiert

Mehr laden