Answered
What would the angles be for a 3D vector?
Let x, y, and z be the vectors' three components. The angle the vector makes relative to the positive x-axis can be computed as...

12 years ago | 3

Answered
Max sum of array elements with condition
You have asked a rather difficult question, Blaz. If the brute force method of trying every possible combination of 15 elements...

12 years ago | 0

Answered
array made of an infinite number of elements
Tristan, as it stands, the quantity 'c' will go to infinity as 't' approaches zero. However, you used the phrase "the shape of ...

12 years ago | 0

| accepted

Answered
changing elements of a multidimensional array using matlab
m + randi(10); n = randi(10); x = zeros(m,n); for p = 1:m for q = 1:n x(p,q) = randi(3); end end You c...

12 years ago | 0

| accepted

Answered
Inserting a constant array in between each of the coloumns
You can't place a 1 x N row vector between columns - it wouldn't fit. So I assume you really mean place it between rows. If th...

12 years ago | 0

Answered
Writing a code to find area of polygon
If you wish to avoid using 'polyarea', one method is this. Let x and y be vectors of the corresponding coordinates of the polyg...

12 years ago | 0

Answered
Help using fzero to solve a specific equation
It may be of some interest to you that solutions to your equation can be expressed explicitly in terms of the 'lambertw' functio...

12 years ago | 0

Answered
generalized eigenvalue problem using matlab
What would you expect it to do, Zhao? Yes, V could be any 3 x 3 matrix of orthonormal column vectors, so in desperation it has ...

12 years ago | 0

Answered
more precision,a problem occured..
Unless you use numbers in the Symbolic Toolbox or perhaps one of John D'Errico's File Exchange programs, there is no matlab comm...

12 years ago | 0

Answered
[ylny + e^(-xy)]dx + (1/y - xlny)dy = 0
You can attempt to find an explicit solution using 'dsolve'. See its documentation at: http://www.mathworks.com/help/symbol...

12 years ago | 0

Answered
How to create a random row vector whose sum of elements and number of elements is at my desire?
If only positive integers are allowed (>0) then do: m = 20; % Choose the desired sum n = 5; % Choose the number of integer...

12 years ago | 6

Answered
Any ideas on locating complex numbers in a matrix and changing their value to zero?
Z(imag(Z)~=0) = 0;

12 years ago | 1

| accepted

Answered
i want to implement this transformation formula on any image, give me code, links , tutorials related to it ?
Chitresh, I can tell you what kind of mathematical problem your expression is a solution to. Let us have n x and y pairs x ...

12 years ago | 0

Answered
I have 4 equations and 3 unknowns for trilateration problem. I wanna solve these 3 unknowns from these equation accurately.
Like Matt J, I suspect you ask too much of your four spheres. In general three spheres will intersect in just two discrete poin...

12 years ago | 1

Answered
For loop repetition question
Are you certain you want matrix power in A^t rather than element-wise power as in A.^t? Either way, your coding can be made mor...

12 years ago | 0

Answered
How would I generate an n-sided shape wher n >= 4
That hint "a vector for each segment can be found by adding the vectors drawn from the origin to each of two adjacent vertices" ...

12 years ago | 0

Answered
Changing variables in Array
I am guessing that by "account" here you actually mean "column". Is that correct? If so, with your 2D matrix called M and a ne...

12 years ago | 0

| accepted

Answered
How to pick the elements in a vector with row coordinates satisfying a criterion determined by another vector?
C = B(find([diff(A)~=0,true])); Note that for this to work, B should have at least as many elements as A.

12 years ago | 0

Answered
How to create an equally spaced 1D array?
You haven't made it clear if the y values are the result of some kind of measurement independent of x steps, but to have any hop...

12 years ago | 0

| accepted

Answered
apply "IF" condition to a matrix whitout loop
That won't work with 'if'. It won't come true unless all the elements are negative. Use logical indexing. t = x>1; x(t) =...

12 years ago | 1

| accepted

Answered
Matlab problem, not sure how to solve a certain simultaneous equation?
Using atan2 will give you 5/6*pi radians as an answer. However, you should understand that there are infinitely more possible a...

12 years ago | 0

Answered
Numerical integration gauss legendre
There is a function in matlab's Symbolic Toolbox Mupad called "numeric::gldata" described at: http://www.mathworks.com/help/...

12 years ago | 0

| accepted

Answered
reducing time in using for-loop
Why not try a direct computation with the data rather than using 'arrayfun'.? It just might be faster. X = A(:,1); Y = A(...

12 years ago | 0

Answered
I have the matrix a=[5 5 10 10 2 4 5],I want the result to be d=[5 1 2 7;10 3 4 0;2 5 0 0;4 6 0 0],
Here's another version. Let a be your array and d be the desired result. [u,t,q] = unique(a(:),'first','stable'); [q,p] =...

12 years ago | 0

Answered
Solving a system of 7 equations with solve is producing empty solutions, any ideas?
Those equations are all linear in the seven unknowns, and there is no reason 'solve' shouldn't be able to solve them very easily...

12 years ago | 0

Answered
why there is a difference in the calculation result
There is no reason those quotients should be equal. The quantities h2 and tsqr are not proportional to one another. For one th...

12 years ago | 0

Answered
I want to pad zeros in the the array of 126*126 ... how to do it... ??
Let M be your matrix: [m,n] = size(M); M = [zeros(1,n+2);zeros(m,1),M,zero(m,1);zeros(1,n+2)];

12 years ago | 0

Answered
Maximum variable size allowed by the program is exceeded.
Perhaps matlab is objecting to a matrix with 2^26 = 67,108,864 elements. That's a very large matrix.

12 years ago | 0

Answered
Convert from Rows to Column in Matlab
If these values A, B, C, etc. as shown are in a 31 x 24 matrix called Mat1, then do: Mat2 = reshape(Mat1',[],1);

12 years ago | 3

Load more