Answered
Angle betwen an edge and a geodesic line, which are both members of the same mesh?
If the three vertices you refer to are column vector vertices, P1, P2, and P3, of a triangle, and you want to find the inner ang...

13 years ago | 0

Answered
4x5 Matrix solution C=B/A receiving four solutions
The error message is certainly misleading. The problem is that if A is 4-by-4 and B is 4-by-1, the expression C = B/A is invali...

13 years ago | 0

Answered
Equivalent of beta functions
Use this formula for betapdf(x,a,b) to handle a larger range of a and b values: y = exp(-betaln(a,b)+(a-1)*log(x)+(b-1)*log(...

13 years ago | 0

Answered
Equation of Two Masses Of Center of Gravity
Let the lower box have width a and height b, and for the upper box width c and height d. Let e be the amount the upper box is o...

13 years ago | 1

Answered
Create and rotate a vector field out of two matrices (x and y component)
For brevity call X = data2_var1 and Y = data2_var2. Do things this way: vR=[X(:),Y(:)]*R; X2 = reshape(vR(:,1),size(X)); ...

13 years ago | 0

| accepted

Answered
Improving speed of nested loops
You are executing the line containing 'fc10' 144 million times, so you must expect your code to take a long time. If it is an a...

13 years ago | 1

| accepted

Answered
Trouble formulating minimization problem
I assume V is of double type. [m,n] = size(V); [x,y] = ndgrid(1:m,1:n); x = x(:); y = y(:); P = [x.^2,y.^2,x.*y,x,y,on...

13 years ago | 0

| accepted

Answered
How can I combine two columns?
If M is your two-column matrix M = mean(M,2);

13 years ago | 2

Answered
Equivalent of beta functions
The 'betainc' function in the regular matlab package computes the same function as 'betacdf' in the Statistics Toolbox. As for ...

13 years ago | 0

Answered
maximum eigenvalue of a matrix with rank one update
Yang, you appear to expect some direct relationship between the maximum eigenvector of A(t-1) and that of A(t), possibly also in...

13 years ago | 0

| accepted

Answered
Compute Rotation Angle from Procrustes Rotation Matrix
To do that you need to receive the third output from 'procrustes' which is a structure. Its 'T' component gives the rotational ...

13 years ago | 1

| accepted

Answered
How do we know that MATLABs algorithms are working properly?
Yes, there are many people, including myself, who would welcome this kind of transparency in all such computing systems! In my ...

13 years ago | 1

| accepted

Answered
ploting a 'complete' catenary curve by using a solver
As you have written the differential equation with the given initial conditions and with x increasing from 0 to 2, there is no o...

13 years ago | 1

Answered
Need help with integrals and derivatives
You should not be using 'trapz' in this problem in which you can calculate, (using some standard calculus or matlab's symbolic t...

13 years ago | 1

Answered
Problem Creating a Function
Strictly speaking, you cannot define a (single-valued) function that does what you depict, since it is undefined at t = 0. It i...

13 years ago | 1

Answered
problems coding to find function values
Since you are using an explicit, continuous function to approximate your growth curve, there is no point in dealing with discret...

13 years ago | 1

| accepted

Answered
finding inverse gamma distribution in bayesian analysis
It looks as though the definition of gamma distribution parameters you are using does not coincide with that used by the matlab ...

13 years ago | 2

Answered
how diff command works?
You have clearly created the rightmost column by taking the 'diff' of the left column and dividing by 165, and then duplicating ...

13 years ago | 0

Answered
Find numbers within (n)
The idea with the 'find' operation is to recognize a change of more than 2 in successive elements of the sorted list B. The 'di...

13 years ago | 0

Answered
Simple Question about Optimization of Nested IF-FOR loops
Sorry! It should have been: t = repmat(SliceMaskUr==1,[1,1,iNZ]);

13 years ago | 0

Answered
Find numbers within (n)
[B,p] = sort(A); f = find([true,diff(B)>2,true])'; R = [f(1:end-1),f(2end)-1]; % Start and end indices w.r. to B This is...

13 years ago | 0

Answered
Double To Binary Representation (not using dec2bin)
Many years ago I wrote a function to do what you describe for my ancient version of matlab. I called it 'binstr'. I believe th...

13 years ago | 0

| accepted

Answered
Matrix as input argument of a matlab function
Check that you don't have another function named 'add' on your system that calls for more than two inputs and is being mistakenl...

13 years ago | 0

Answered
Simple Question about Optimization of Nested IF-FOR loops
Is 'iPointsinSlice' a scalar? If so and if it is not positive, nothing will happen here. Next, don't you mean "m+(l-1)*iNX+(...

13 years ago | 0

Answered
fminimax fails to minimize objective functions
I don't have the time to carefully analyze your code, Matias, but my impression from the way you have worded your problem is tha...

13 years ago | 1

Answered
How can i speed up this part of my code?
In your code the multiplication part of doing phi1'*p1*phi1 is being repeated over and over again as you select different...

13 years ago | 0

| accepted

Answered
What does this line of code mean in non-code speak?
In other words, this logical statement is true when 'year' is to be a leap year under the Gregorian calendar. They could just a...

13 years ago | 0

Answered
How to vectorize a for loop with an if condition inside
L = reshape((1:Nx*Ny*Nz),Nx,Ny,Nz); L = reshape(L(1:end-1,1:end-1,1:end-1),[],1); N = [L,L+1,L+4,L+3,L+9,L+10,L+13,L+12]; ...

13 years ago | 1

| accepted

Answered
In which system of units do we get outputs of functions...i mean if we get a plot using scope ..we get different values of x and t ...but are they in S.I system..how do we come to knw..
The interpretation of numerical quantities within a computer in terms of units is always a matter of understanding between progr...

13 years ago | 0

Answered
Deciding zero's to a polynomial function
Use 'fzero' and replace e^-x with exp(-x).

13 years ago | 0

Load more