Respondida
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...

alrededor de 9 años hace | 0

Respondida
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...

alrededor de 9 años hace | 0

| aceptada

Respondida
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...

alrededor de 9 años hace | 0

Respondida
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;...

alrededor de 9 años hace | 4

| aceptada

Respondida
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 ...

alrededor de 9 años hace | 0

Respondida
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...

alrededor de 9 años hace | 0

Respondida
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-‘)

alrededor de 9 años hace | 0

Respondida
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 ...

alrededor de 9 años hace | 0

Respondida
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...

alrededor de 9 años hace | 0

| aceptada

Respondida
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. ...

alrededor de 9 años hace | 0

Respondida
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, ...

alrededor de 9 años hace | 1

Respondida
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...

alrededor de 9 años hace | 0

| aceptada

Respondida
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 =...

alrededor de 9 años hace | 2

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

alrededor de 9 años hace | 1

Respondida
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...

alrededor de 9 años hace | 0

Respondida
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;

alrededor de 9 años hace | 0

Respondida
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 ...

alrededor de 9 años hace | 0

Respondida
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); ...

alrededor de 9 años hace | 1

Respondida
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; ...

alrededor de 9 años hace | 2

| aceptada

Respondida
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...

alrededor de 9 años hace | 0

Respondida
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...

alrededor de 9 años hace | 0

| aceptada

Respondida
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...

alrededor de 9 años hace | 1

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

alrededor de 9 años hace | 0

Respondida
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...

alrededor de 9 años hace | 1

Respondida
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 ...

alrededor de 9 años hace | 0

Respondida
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...

alrededor de 9 años hace | 0

| aceptada

Respondida
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.

alrededor de 9 años hace | 0

Respondida
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...

alrededor de 9 años hace | 0

Respondida
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...

alrededor de 9 años hace | 1

| aceptada

Respondida
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 ...

alrededor de 9 años hace | 0

Cargar más