Answered
Numel error cant figure out why
It looks as though the exact equality demanded by "==" never occurred and so the 'break' did not happen, but your value of 'poin...

11 years ago | 1

Answered
svd prescision is very bad.
You cannot expect them to be exactly the same because of rounding errors. Have you compared them using "format long" to see how...

11 years ago | 2

Answered
does mldivision have any exceptions? I used it to solve an equation and the values I got were wrong.
You mustn't use "==" to check your answers because that doesn't allow for round-off errors. I checked the answers you obtained ...

11 years ago | 1

Answered
what is meant by the following error and how correct it?
My guess is that somewhere in your code you have used the string 'length' as a variable and that is what matlab interprets 'leng...

11 years ago | 2

| accepted

Answered
Do not understand why my code isn't working!
The third argument in 'linspace' is interpreted as the number of desired points, so you will get at most one point in each one. ...

11 years ago | 1

| accepted

Answered
I am confused with scalars!!!
Apparently your variables 'mi', 'ma', 'a1', 'b1', ..., are arrays with more than one element - that is, they are not scalars. C...

11 years ago | 5

| accepted

Answered
Recursively generating permutation matrices
The following generates every possible matrix M satisfying your requirements. Moreover they don't need testing, since every one...

11 years ago | 2

Answered
How can i get the index of the submatrix D, that correspond to the maximum determinant?
A = randn(2,4);%this will give me a 2rows by 4columns matrix b = 0; for i=1:1:4 for j=(i+1):1:4 b=b+1; D=[...

11 years ago | 2

| accepted

Answered
(Optimization) How to quickly get coordinates (coordinates are integer) of all possible points inside a specific cylinder?
The hard part of your question is formulating the equations of the cylinder's bounding surfaces. If P1 = [x1,y1,z1] and P2 = ...

11 years ago | 3

| accepted

Answered
how do i get rid of the fractions on array calculations
You need to proceed differently in your for loops. n = 631; for ix = 1:n X = .1*(ix-1)+1; for iy = 1:n ...

11 years ago | 2

Answered
Why is the code not implementing for i==6 value ?
I see one apparent error. The condition (i==1 i==7) will never be true. You need an 'or' symbol in it: (i==1 | i==7). Also ...

11 years ago | 2

| accepted

Answered
Help with a System of linear inequalities (with 12 variables)
I can give you one hint. Consider one of the equations, say, the last one: I = 18 - J - K We know that the sum J+K can...

11 years ago | 0

Answered
Integrate symbolic function & maintain constants in solutions
As I mentioned to you yesterday, you are unlikely to get a symbolic answer from 'int' as a function of a1, a2, and a3, because ...

11 years ago | 2

Answered
Symbolic matrix algebra calculation
If you use the form a = sym('a',n) or a = sym('a',[m.n]) to declare symbolic vectors or matrices, I seriously doubt that the ord...

11 years ago | 2

Answered
Double numeric integral of a function help please
You need to make the integration limit sqrt(1-x^2) a function handle. See the documentation at http://www.mathworks.com...

11 years ago | 1

| accepted

Answered
how can i get x/y to be on the left of the equation a = x - b* y ?
y/x = (x-a)/(b*x) Note: There is no way you can solve for y/x entirely in terms of a and b. It isn't uniquely determined...

11 years ago | 0

Answered
Integrate symbolic expression while maintaining constants
Unless I am mistaken, that integrand gives rise to an elliptic integral, and probably 'int' is unable to express its integral in...

11 years ago | 1

Answered
How do I get formula for the nth term of this on matlab?
Since I made an error in my first answer, here is a bit more information. The problem can be expressed this way: x(1) = s...

11 years ago | 1

Answered
How do I get formula for the nth term of this on matlab?
It doesn't matter what you initialize it at, the limit as n approaches infinity is always 2, not 3. Correction: You were rig...

11 years ago | 1

Answered
Tricky formula with cumulative sum
To use 'cumsum' you need to get the u's out of the squared expression. Let's assume X and u are row vectors. Y = cumsum(X.^...

11 years ago | 2

| accepted

Answered
Vectorize my code in azimuth calculation.
You could try this. It calls on 'azimuth' in the same sequence as in your for-loop code, but it is vectorized. Whether it is f...

11 years ago | 0

Answered
how can I evaluate a four fold integral with four variables numerically ?
Set up a function which, when given the value of the outermost variable of integration, calculates the triple integral of the in...

11 years ago | 2

Answered
How I can integrate symbolically a function of probability?
To get the proper answer you need to extend the range of x over which f1(x) is defined. When you run int(f1(x),x,0,1), the 'int...

11 years ago | 0

Answered
hamming distance in one matrix
B = [10100100010001001; 01110010100110010; 10000100001000111; 11100011111000011]; D = pdist...

11 years ago | 1

| accepted

Answered
Please clarify this statement?
Read about the 'colon' operator here: http://www.mathworks.com/help/matlab/ref/colon.html and the 'end' array index her...

11 years ago | 0

Answered
Need help to solve and plot implicit diode equation
@Abhi. The explicit solution for I in the equation Il-Io+exp(q*(V+I*R)/(n*k*T))-(V+I*R)/S = I which I obtained using m...

11 years ago | 1

Answered
Need help creating matrix (Easy)
M = reshape((1:7)'*(1:5),1,[]);

11 years ago | 0

Answered
Help writhe a fixed point algorithm
This problem is ideal for using matlab's 'while' function. You can read the details about it at: http://www.mathworks.com...

11 years ago | 1

| accepted

Answered
Hi I tried to run the following and it keeps giving me the following. Can somebody help me fix it.
The problem here is that inv(xn'*xn)*xn'*y has two elements in a size 2 x 1 vector, while you are trying to place them in a sing...

11 years ago | 1

| accepted

Load more