Answered
How to solve this code error in
The vector 're' has 2 elements and 'ne' has 3 elements, so the element-by-element multiplication re.*ne becomes meaningless. Ho...

11 years ago | 0

| accepted

Answered
What is a vectorized way to calculate variance of an image patch
You do need to answer Walter's question. Here are two possibilities: 1) From your I = 560 x 560 x 3 array, each 8 x 8 x 3 bl...

11 years ago | 1

| accepted

Answered
How to solve 5 equations with 5 unknowns
You can use 'solve' in the Symbolic Toolbox to solve them. My alternate method was in error. Just use 'solve'. It does very...

11 years ago | 0

| accepted

Answered
How to calculate product of the odd positions and the sum of the even positions?
Big hint (almost a give-away): vec_in(1:2:end) is the vector of all odd-positioned elements.

11 years ago | 1

Answered
keep first time a value appear in a colomn and replace following ones
B = (A==0); B = A + (B & cumsum(B)>1);

11 years ago | 0

Answered
Center of Mass of a Tetrahedron
((x1+x2+x3+x4)/4,(y1+y2+y3+y4)/4,(z1+z2+z3+z4)/4)

11 years ago | 1

Answered
how to seperate even or odd elements and make row vectors from a matrix
The only error I see is that your returned values are in reversed order. According to the statement of the problem you should h...

11 years ago | 0

| accepted

Answered
another method to for loop
There is one obvious way to speed things up. Your test for ind(i)==ind(j) is totally unnecessary and can be eliminated, because...

11 years ago | 0

Answered
Problem with for loop
You have interpreted the phrase "get an error of 0.01%" far too literally. What is clearly meant is to find the smallest n such...

11 years ago | 1

| accepted

Answered
replace matlab function with algorithm
I have given you a pretty good hint four days ago at solving your problem in the #218267 Answers thread. Why don't you try usin...

11 years ago | 0

Answered
can someone explain me this code please?
This looks like a misguided attempt to use trapezoidal approximation to find the integral of y = x^3 over an interval in x. The...

11 years ago | 1

Answered
how to find overlapping circles in matlab
Two circles will overlap if and only if the distance between their centers is less than or equal to the sum of their radii.

11 years ago | 2

Answered
To accept two numbers from the user and display perfect numbers between these two numbers.
As part of your procedure in identifying a perfect number you need to determine the sum of all the divisors of a given integer, ...

11 years ago | 0

Answered
Taking derivative an array which is a numerical value with respect to another array
Here is a second order approximation to du/dx which should be somewhat more accurate than a first order approximation, and if u ...

11 years ago | 1

| accepted

Answered
how to find all integers between two integers
Another hint: Check out the 'circshift' function.

11 years ago | 1

Answered
calculation of slopes of 2 lines
If your lines are three-dimensional, the concept of "slope" loses its significance. To find the angle between the lines, you can...

11 years ago | 0

Answered
plz help me with this error "Matrix dimensions must agree."
From your error message I would guess that the matrix created for i1 is of different size from that of i2, and consequently matl...

11 years ago | 0

| accepted

Answered
if command for finding more than three identical numbers in a variable
You can devise your own test: if any(diff([0,find(diff(v)~=0),size(v,2)])>3) ...

11 years ago | 0

Answered
how to find cosine angle known the end points of 2 linesegments
Using 'atan2' or 'atan2d' and cross product is more accurate for angles that are near zero or near pi (180 degrees.) a = a...

11 years ago | 0

Answered
I need to solve an equation set :(
What you have here is the equivalent of 32 linear (scalar) equations in 32 unknowns. A (somewhat desperate) solution is to conv...

11 years ago | 0

Answered
converting numbers to matrix(matrix formation)
Use the 'reshape' function.

11 years ago | 1

| accepted

Answered
Need help writing a code
It would be easy to write the code for this problem, or even to just mention certain matlab functions that would do the job easi...

11 years ago | 0

Answered
Intersection between line and circle+ values?
Let P1 and P2 each be two-element column vectors with the coordinates of two points on the line, let C be the column vector of t...

11 years ago | 2

Answered
How can I use matlab to find the solution of an equation when equal to zero using variables without substituting with numbers?
That is what the 'solve' function of the Symbolic Toolbox endeavors to do. It is not always successful, but it capable of some ...

11 years ago | 0

| accepted

Answered
Resultant of 3 Vectors - find value and degree
First figure out the two coordinates of each of the three vectors and then just add the three vectors element-wise to get the re...

11 years ago | 0

Answered
General question about the precision of computations
First, you should understand that your computer uses binary digits, not decimal digits. If you are using double precision float...

11 years ago | 1

Answered
it is a problem of data types ?
The problem here is that 'ctr' of v(ctr) is not the same size as whatever the output of 'fscanf' is at that point, so matlab doe...

11 years ago | 0

| accepted

Answered
How i can create a n+1 column matrix from n column matrix?
It looks to me as if you need to use: b = nchoosek(1:5,4);

11 years ago | 0

| accepted

Answered
How I use a parabola in the xy-plane as base curve for the cylinder?
For a hyperbola, x^2/a^2-y^2/b^2 = 1, replace the two lines for X and Y by: X = a*cosh(V); Y = b*sinh(V); For a par...

11 years ago | 0

| accepted

Answered
Negative number in Matrix or for loop or vector
For the first question, you need to distinguish between index values and the values stored at those locations. The former must ...

11 years ago | 1

| accepted

Load more