Answered
Calculating angle between neighboring vectors in vector field
I can tell you how to compute the angle between any two vectors in your vector field. I have no idea how you plan to depict suc...

13 years ago | 1

Answered
How to make the inverse operation of a " \ " operator ?
In general there will not be enough information to deduce A from B and X. Consider the simple case where B is 1 x 1, X is 2 x 1...

13 years ago | 3

| accepted

Answered
Error message: index must be a positive integer or logical
The variables 'Q' and 'F_QX' are defined as row vectors in your code. Yet you have accessed them as two dimensional arrays. Th...

13 years ago | 0

Answered
Comparing arrays between matrices in random order
The following assumes that any row occurring in both A and B and multiple times in either one of them will nevertheless be count...

13 years ago | 1

Answered
I want to get vector of det
If you express the matrix properly as a 4 x 4 matrix, det([a;b;c;d]), matlab will give you its determinant. Your express...

13 years ago | 0

| accepted

Answered
finding best and wost case in Insertion Sort
It is not clear what you are asking. With a given array such as the one you describe, there can be no "best" or "worst" case. ...

13 years ago | 0

Answered
how to get mean and std from a known CDF curve
If you can manage to transform the cdf plot into two arrays, one the discrete variable values, 'v', and the second the correspon...

13 years ago | 0

| accepted

Answered
Generating a particular sequnce of numbers
Here's another method to try: N = d*(d+1)/2; A = zeros(1,N); n = 1:d; A((n.^2-n+2)/2) = n; A = cumsum(A)-(1:N)+1;

13 years ago | 4

Answered
how to make it short codes?
If I have understood your question correctly, you can keep the first three lines: B = imread('filename'); a = reshape(B(1:...

13 years ago | 1

Answered
Rendering an ellipse in polar coordinates that is not circumscribing the origin
Just generate the ellipse parametrically in cartesian coordinates and transform these to polar coordinates. That way it won't m...

13 years ago | 2

Answered
minimum row value and return the row
You have not told us what aspect of rows you are minimizing. I will guess you want the row index of the row with the least sum....

13 years ago | 0

Answered
check the repeated values...count them and find mean
The 'tm' you show in your code has only one column. When you write tm(:,2), matlab will complain. It looks as if you intended ...

13 years ago | 0

| accepted

Answered
Keep only certains rows (continuation)
A variation on Matt's method which takes advantage of the fact that column 1 in B is already sorted. B = sortrows(A,[1,2]); ...

13 years ago | 1

Answered
check the repeated values...count them and find mean
Call your first array 'a' and the second 'b'. [u,~,ix] = unique(a(:,1)); b = [u,accumarray(ix,a(:,2))./accumarray(ix,1)]; ...

13 years ago | 0

Answered
how to build all binary vectors of length n whose number of its zero elements is m<n?
N = 0; for k = 0:m N = N + nchoosek(n,k); end A = ones(N,n); q = 1; for k = 1:m p = nchoosek(1:n,k); for ...

13 years ago | 0

Answered
Cross product in Simulink
Can you do this in Simulink: t1 = [2,3,1]; t2 = [3,1,2]; C = A(:,t1).*B(:,t2)-A(:,t2).*B(:,t1); If so, that will give...

13 years ago | 0

| accepted

Answered
Repeat every element in matrix
A = reshape(repmat(A(:)',200,1),[],3); This repeats the elements in the columns. If you want to repeat the along the rows d...

13 years ago | 1

| accepted

Answered
How to make function f(x)=-x periodic of (2*pi) explicitly?
f(x) = mod(-x+pi,2*pi)-pi;

13 years ago | 0

| accepted

Answered
Simple counter won't trigger if statement
This is a classic beginner's problem. Your computer uses binary floating point numbers, and as such cannot exactly represent th...

13 years ago | 0

| accepted

Answered
How do I average a time series with uneven intervals?
One possibility is to use 'interp1' set to interpolate at some appropriate multiple of one hertz, say, 20 Hz. You can select th...

13 years ago | 0

| accepted

Answered
how to do tri-sector partition in my hexagon?
The explanation you give is far from complete, but it suggests the following interesting problem which makes it worth working on...

13 years ago | 0

Answered
Generate number from a probability distribution
(I presume that since you took a simple cumsum of your pdf values, these were equally spaced with respect to the random variable...

13 years ago | 0

Answered
.Alternate to using for loop or symsum for the summation ∑(const)^n/(n*n!) ?
Your sum is equal to the integral int('(exp(x)-1)/x','x',0,const) so you could do numerical integration of this rather th...

13 years ago | 0

| accepted

Answered
What is the error in this code for calculation of fibonacci number using golden ratio concept
No, it doesn't work like that. The expression 's=(1+1/s)' tells how the golden ratio is defined, namely s = (1+sqrt(5))/2. Loo...

13 years ago | 0

Answered
Shortest Distance between two vectors
If by "distance" you mean the Euclidean distance between the vectors considered as "points" in n-dimensional space, n being the ...

13 years ago | 0

Answered
Warning: Explicit integral could not be found.
Apparently 'int' is not quite smart enough to make a change of variables. If you change the variables to polar coordinates: ...

13 years ago | 0

| accepted

Answered
how to calculate translation and rotation of points of image from 2 consecutive frames
There is a function in the Statistics Toolbox called 'procrustes' which can do that job for you. Read its documentation at: ...

13 years ago | 0

| accepted

Answered
geumetry analysis of robot arm
This problem doesn't really belong in this group but okay, I'll answer it. Given that arm L3 is parallel to the ground, call ...

13 years ago | 1

| accepted

Answered
Projecting Points to a new Basis
P = (A'*A)\(A'*B); P will be an n by 520 matrix. Each column of P has the n components with respect to basis A of the corre...

13 years ago | 0

Answered
How do I create an image of a 3d polygon that is always orthogonal to the polygon?
Let P be a 3 by n matrix containing the coordinates of n vertices as three-element columns. Assume they are in counterclockwise...

13 years ago | 0

Load more