Answered
calculating trace of matrix without calculating the matrix itself
Let tmp be an n by n matrix. B = tmp(vecx+n*(vecy-1)).'; (Note: The ‘trace’ is the sum of the diagonal elements of A, no...

10 years ago | 0

Answered
Subscripted assignment dimension mismatch
’temperature' is an array, not a scalar, and when the scalar 'matrice_cartesian(i,10)' is subtracted from it, it remains an arra...

10 years ago | 0

| accepted

Answered
Sample from multivariate exponential distribution
You can make use of the ‘gammaincinv’ function for this problem: X = randn(m,n); X = X.*repmat(gammaincinv(rand(m,1),n...

10 years ago | 0

Answered
hey guys.,x1=[6.630]; y1=[12.294]; z1=[-1.457]; x2=[7.613]; y2=[12.686]; z2=[-0.404]; x3=[8.324]; y3=[11.427]; z3=[0.102]; x4=[9.372]; y4=[11.018]; z4=[-0.564]; these are coordinates to calculate phi and psi angles, please tell me how i should do.?
(Corrected) I am assuming that the four sets of coordinates you describe correspond to four points P1 = [x1;y1;z1], P2 = [x2;y2;...

10 years ago | 4

| accepted

Answered
MVNRND in PC vs. MAC
It is likely that very small differences in the computations that produced your ‘sigma’ matrix are the cause of the differences ...

10 years ago | 0

Answered
How can I write such an equation on Matlab?
Recursion is not a good idea on an iteration of this sort where at each step two different earlier levels are consulted. At the...

10 years ago | 0

Answered
Draw the curve in the x–y plane for which ||(x; y)||inf = 2
plot([-2,2,2,-2,-2],[-2,-2,2,2,-2],’y-‘)

10 years ago | 0

Answered
How to store the results from an iteration process?
You have one too many for-loops clear all A = (1:10)'; x = [5,11]; for i = 1:2 C(:,i) = A * x(i); end ...

10 years ago | 0

Answered
how to define an ellipse using a tangent line and point ?
Arbitrary ellipses in a given two-dimensional plane enjoy five degrees of freedom - that is to say, in a sense they occupy a fiv...

10 years ago | 0

| accepted

Answered
Warning: Explicit solution could not be found. In solve at 81 ans = [ empty sym ]
By a certain trick my ancient version of ‘solve’ can find the solution to your problem which involves the ‘lambertw’ function. ...

10 years ago | 0

Answered
Find length of intersection between 2 points and a sphere
Since this problem is in three dimensions, you can also make use of the cross product function to compute L as follows. Again, ...

10 years ago | 1

Answered
how can i calculate a equation including exceeding value of realmax
It is essential that you include the exp(-lambda), which is part of the Poisson distribution, in your calculations. p(x,lam...

10 years ago | 0

| accepted

Answered
Find length of intersection between 2 points and a sphere
Let P1 = [x1,y1,z1], P2 = [x2,y2,z2], and P0 the sphere center. v = P1-P0-dot(P1-P0,P2-P1)/dot(P2-P1,P2-P1)*(P2-P1); L =...

10 years ago | 2

Answered
How to remove zero sum row from matrix
A = A(:,(A(2,:)+A(3,:)~=0));

10 years ago | 1

Answered
how to convert u(r,z) (axisymmetric) data to u(x,y,z)??
Probably I don't understand your question, but it would seem that the following is the obvious answer, where uppercase 'U' is th...

10 years ago | 0

Answered
Vectorizing the creation of an (m x n) matrix where each row represents a number
Assuming y is a column vector yk = zeros(m,n); yk((1:m)’+m*(y-1)) = 1;

10 years ago | 0

Answered
How to solve DE by matlab
I can help you a little in finding the analytic solution. Temporarily consider that y is the independent variable and t is the ...

10 years ago | 0

Answered
Plot a Surface on a circle and annulus
For the circle (disk) do this: [T,R] = meshgrid(linspace(0,2*pi,64),linspace(0,2,16)); X = R.*cos(T); Y = R.*sin(T); ...

10 years ago | 1

Answered
how to add combinatorics function in matlab with n different objects divided into r groups and each group get at least 1 object
C = zeros(r^n,n); t = 0; for k = 0:(r^n)-1 s = dec2base(k,r,n); if length(unique(s))==r t = t+1; ...

10 years ago | 2

| accepted

Answered
How do I select values bigger than a certain value & at least 4?
Let A be your 2500 by 1 row vector. f = find(diff([false;A>150;false])); f1 = f(1:2:end-1); ix = f1(find(f(2:2:end)-f...

10 years ago | 0

Answered
How can I solve this problem?
In “ _observe a relationship recurrence between two successive terms, Ti+1 and T1_ ” I believe you are being asked how the n+1-s...

10 years ago | 0

| accepted

Answered
Solving an Integro-differential equation numerically
I hate to see numerical approximation methods used when there exists a very simple and precise method done by hand. First we de...

10 years ago | 1

Answered
how to do sum up elements one by one (sequence addition)
cumsum([1 2 3 4]) equals [1 3 6 10]

10 years ago | 0

Answered
How many combination will appear
I hope you have a lot of memory available to matlab! B will be of size 85900584 by 7. That is, there will be 49!/7!/42! combin...

10 years ago | 1

Answered
How to put data in vector into matrix
The following is an example of inserting a row vector, V, into an m by n matrix, M, in a “spiral transposition”. The spiral in ...

10 years ago | 0

Answered
I would like to know how I can have the line of a matrix.
By “line” I assume you mean “row”. If you know the row in A that has its maximum, that is the same row as the one in P that wou...

10 years ago | 0

| accepted

Answered
How may I use the find function to search a range or rows and a specific column please?
The 'B' values are the column indices of the matrix X(1:3,4), and relative to this matrix those column numbers are all ones.

10 years ago | 0

Answered
How to calculate the area between the curves y=1/x and x-axis from 3 to inf
Such an area would be infinite-valued. You have to find the integral of 1/x with respect to x from 3 to infinity, and that give...

10 years ago | 0

Answered
Create and plot random points with connected lines
Assume that A is symmetric with zeros on the diagonal (bidirectional connections) and that there are n points. x = rand(n,1...

10 years ago | 1

| accepted

Answered
Non-linear Implicit function plot
You could plot it using a third variable, t: n = 200; t = linspace(-2,2,n); % <-- Choose appropriate range for t for ...

10 years ago | 0

Load more