답변 있음
damage equation for uniaxial compression
By multiplying by the product of the two denominators, the equation becomes that of a cubic polynomial in k which will in genera...

11년 초과 전 | 0

답변 있음
how to simulate markov chain
If T is the 5 x 5 transition probability matrix, to find the n-th state, do this: xn = T^n*[0;0;0;1;0];

11년 초과 전 | 0

답변 있음
How to do it more efficiently?
See if this is faster: [t,ic] = ismember(time_synced,cCells(:,1)); curArr(t) = cCells(ic); curArr(~t) = NaN; No...

11년 초과 전 | 0

| 수락됨

답변 있음
Help comparing two matrices
C = sign(A-B);

11년 초과 전 | 4

답변 있음
how to determine the position of points which belong to a circle ?
If the center is at (x0,y0) and the radius is r, then 1) if (x-x0)^2 + (y-y0)^2 < r^2, the point (x,y) is inside the circle...

11년 초과 전 | 4

| 수락됨

답변 있음
Help with a two variables equation?
In the line T(x,t)=((2*q)/(k))*...... if T is to be a matrix of values, then the 'x' and 't' values must be indices whi...

11년 초과 전 | 0

답변 있음
how to generate a random vector sized 1x100 or 100x1 without the numbers (mod,5)=0 ?
If you want to range uniformly over the first N positive integers that are not divisible by 5 and you want n random samples, do ...

11년 초과 전 | 2

답변 있음
Optimizing a simple code
For your particular problem there is a way to avoid the for-loop using the colon operator, but I doubt if it is what you had in ...

11년 초과 전 | 1

| 수락됨

답변 있음
Odd behaviour of 2x2-matrix and 2x1-vector operation
Both the differences in real parts and the spurious imaginary parts in y0 and y1 are extremely small and are undoubtedly due to ...

11년 초과 전 | 2

| 수락됨

답변 있음
how to generate random numbers from a distribution which is the convolution of exponential distributions?
By integrating from 0 to infinity it can readily be determined that the cdf for your density p(x) = x/I^2*exp(-x/I) would be ...

11년 초과 전 | 1

답변 있음
How do i solve 2 equations for 2 unknowns?
For each of the eight pairs of equations you are asking for the two intersections of two circles. Here is a direct solution ext...

11년 초과 전 | 1

답변 있음
how to make looping for random data and discrete
(You should not use the name 'size' for one of your variables, since that is the name of one of matlab's functions, so I have ta...

11년 초과 전 | 0

답변 있음
Logical Indexing a spefic column in a matrix
If M is the original matrix, c4 = M(:,4); M1 = M(0<=c4 & c4<30,:); % <-- Having the angles between 0 and 30 M2 = M...

11년 초과 전 | 1

답변 있음
how to ignore nan values in corr function?
Clearly there is no sensible way to compute a correlation value for two empty vectors. I would suggest that for such cases you ...

11년 초과 전 | 0

| 수락됨

답변 있음
Dear Friends, please help me in finding (matlab code) the inverse of this matrix. F=[ 1 1 -1 -1; -a b c d; e -f -g h; j k l m]. where a, b, c etc are constants.Best Regards.
The Symbolic Math Toolbox contains the function 'inv' which will find the symbolic inverse of your matrix. Or, if the values ...

11년 초과 전 | 2

| 수락됨

답변 있음
Issue in term mismatch after finding roots
In the expression for 'term1b' you use the variable 'qn'. However, that appears to be the dummy argument for your function 'f'....

11년 초과 전 | 0

| 수락됨

답변 있음
find time elapse in if statement
According to the documentation for 'datenum' at: http://www.mathworks.com/help/matlab/ref/datenum.html *"A serial date ...

11년 초과 전 | 1

| 수락됨

답변 있음
how i can draw a sector of a circle in matlab?
Let r be the circle's radius, P0 = [x0,y0] be its center, and theta be the required angle in radians. a1 = 2*pi*rand; % A...

11년 초과 전 | 4

| 수락됨

답변 있음
Taylor series for multiple variables
See section 9 of the Wikipedia article at: http://en.wikipedia.org/wiki/Taylor_series#Taylor_series_in_several_variables ...

11년 초과 전 | 0

답변 있음
on floating point arithmetic - moler book
Yes, Cleve Moler is correct that the significand (mantissa) portion of IEEE 754 double precision normalized numbers represent 53...

11년 초과 전 | 2

답변 있음
an ode where numerical method fails in matlab
When y nears 1, your differential equation system becomes what is known as 'stiff'. Even though the ideal solution is a perfect...

11년 초과 전 | 1

| 수락됨

답변 있음
randomly picking from a series of elements
To avoid repetitions you can do the following. Let M be the array with 7000 rows from which you wish to select 500 at random. ...

11년 초과 전 | 2

답변 있음
Minimizing an objective function
Unless you place some further constraints on W values, there is no limit to how much 'f' can be reduced. The right answer would...

11년 초과 전 | 1

| 수락됨

답변 있음
How can I form a Hankel matrix for the following example?
Let R be an m x n x r array in which r >= p+q-1 using your definition for p and q. Then do this: T = reshape(permute(R(:,...

11년 초과 전 | 1

| 수락됨

답변 있음
normalize matrix by standard deviation
If A is your MxN matrix and is of type 'double', do this: A = bsxfun(@rdivide,A,std(A)); (This assumes you want unbiase...

11년 초과 전 | 0

| 수락됨

답변 있음
Computing Angles from Coordinate Space
The two lines angle = dot(X1,X2)/3; %cosine angle of rotation angle = acos(cos(angle)); don't make sense to me. On...

11년 초과 전 | 0

답변 있음
how can I determine the areas surrounded by these two plots?
You need to determine the x-coordinates of the three crossing points of the two curves. For that purpose you can use 'fzero', t...

11년 초과 전 | 2

| 수락됨

답변 있음
Question about diff function
h = h - (V/h+2*sqrt(V*pi*h))/(-V/h^2+V*pi/sqrt(V*pi*h)); (Maybe I am old-fashioned, but with elementary functions like thi...

11년 초과 전 | 1

답변 있음
Solving for a symbol and converting it to double to use in a loop
Cramer's Rule is not what you need to solve for w! Setting your determinant to zero will give you an eighth degree polynomial e...

11년 초과 전 | 0

답변 있음
Using "curl" function and its outputs
Provided you enter x and y as inputs to the 'curl' function, the curl output units are of the field units per x-y units. In oth...

11년 초과 전 | 1

더 보기