Answered
Question on residuez results
The actual partial fraction expansion of 3*x^2+x-2/(((x-2)^2)(1-2x)) is: 3*x^2 + x - (4/9)/(x-2) + (2/3)/(x-2)^2 + (4/9)/(...

11 years ago | 0

Answered
I want to divide the domain 0 to pi in 5 parts by geometric progression with common ratio r=1.1? how should i do that?
r = 1.1; a = pi*(r-1)/(r^5-1); x = cumsum([0,a*[1,r,r^2,r^3,r^4]]); The values in x are the six endpoints of the f...

11 years ago | 0

| accepted

Answered
Integral of experimental data
Using 'g' in place of 'gamma', do this: Q = (g*trapz(V,P)+trapz(P,V))/(g-1); or if you want the cumulative integral, re...

11 years ago | 0

Answered
HOW to Overwrite Matrix Values in a loop, not Append!! ??
If you want X and Y to be completely overwritten on each trip through the for-loop, you will have to make some provision for the...

11 years ago | 0

Answered
Defining formulas for diagonal and offdiagonal elements of a matrix
A = eye(length(M))*f1+(1-eye(length(M))*f2; where f1 is the formula for the diagonal elements and f2 that for the off-diag...

11 years ago | 1

| accepted

Answered
what's wrong here? plz help
The trouble is that your initial values for hl and hu both give the same sign, namely positive, to your function to begin with. ...

11 years ago | 0

Answered
What's wrong with this expression?
y=a*exp(-(x-b).^2/c^2);

11 years ago | 0

Answered
rand matrix for FM
If your x values are subject to common upper and lower bounds, you can use my 'randfixedsum' function in the File Exchange, loca...

11 years ago | 4

Answered
how to generate vector [0:0.01:1] using linspace command
linspace(0,1,101)

11 years ago | 0

Answered
What is the MatLab Program for this?
Here's a hint to get you started. Suppose you have two positive integers, a and b. How would you use matlab to determine wheth...

11 years ago | 0

Answered
Zipf Based Number generation
If you want exponent values less than or equal to one, it is necessary to confine yourself to a specific finite number of terms,...

11 years ago | 0

Answered
how to find nearest values of all elements of a matrix to another matrix in matlab
With vectors as large as these it could very well be advisable to sort the second vector. Let A be the first 11527 x 1 vector a...

11 years ago | 0

Answered
How can I solve the least square minimization Ax=b when b is unknown?
Whatever the value of d is, the following will give the least squares approximation for E*p-[d;d;d;d] = 0. x = [x1;x2;x3;x...

11 years ago | 1

| accepted

Answered
How to define variables using triple integrals
See Mathworks' documentation site: http://www.mathworks.com/help/matlab/ref/integral3.html As you can see, if you have ...

11 years ago | 0

Answered
How do I solve this problem? I want to make code to solve this problem. I made the matrix D using triu function in matlab and than D=t+t.'
'Facility_units' must be a row vector of non-negative integers in the following: c = cumsum(Facility_units); ix = cums...

11 years ago | 0

| accepted

Answered
Accessing multidimensional array with pairwise indices
If, as you have indicated, x and y are column vectors, do this: B = reshape(A(bsxfun(@plus,(x+20*(y-1)).',(20*20)*(0:999).'...

11 years ago | 0

Answered
Transcendental equation with fsolve
In a problem such as yours, Daniel, it is always helpful to redefine your variables so as to simplify the expressions, and if po...

11 years ago | 0

Answered
Combining the matrix' values
I think the following generalizes what you have requested for a matrix, A, of arbitrary size: [m,n] = size(A); [J,I] =...

11 years ago | 0

Answered
Integral function gives NaN
My guess is that your 'fun2' at infinity is what is giving 'integral' the trouble. log_normal(rp) is approaching zero and rp^4 i...

11 years ago | 2

Answered
problem with calculation limit
I would think the limit is zero by L'Hospital's rule, but it is possible that matlab's 'limit' function either doesn't know how ...

11 years ago | 0

Answered
How to simplify this piece of code?
You are concentrating too much on getting rid of the for-loops. You should look for unnecessarily repeated operations, whether ...

11 years ago | 1

| accepted

Answered
how to speed up my program? parallel?
There seem to be a number of inefficiencies in this code: 1) If you make 'vp' a row vector and 'xp' a column vector, the expr...

11 years ago | 1

Answered
Error trying to solve an equation
I see a couple of dubious entities in your expression to be solved. First, you have used the backslash symbol, '\', which doesn...

11 years ago | 0

Answered
how to display connection?
I can give you a few ideas. If the x values were all elements of a single vector, you could use for-loops to make comparisons b...

11 years ago | 0

Answered
Getting all the combinations of 4 vectors?
This is the wrong function for your problem. Your problem has 9^4 = 6561 rows of values, which does not correspond to anything ...

11 years ago | 1

Answered
Strange error message in for loop code
I think what this means is that 'vpasolve' found two or more solutions on that 121st iteration, but it was trying to stuff these...

11 years ago | 0

Answered
how to compare two different matrix and set a counter to calculate how many rows matches with all its columns??
You are misusing the 'if' function. Where you write if find ( p1(i,:)==q1(j,:)) the condition will be considered true...

11 years ago | 0

Answered
Subscript indices must either be real positive integers or logicals.
I would guess that somewhere in your system you have defined a variable named 'mean', in which case matlab misinterprets the cal...

11 years ago | 0

Answered
Matlab simple iteration error problem
Your 'newtonroothaha' function has the fatal error that Xest is never replaced by the newly calculated Xnew inside the while loo...

11 years ago | 0

| accepted

Answered
what's wrong with the code?
If you were trying to calculate sin(pi/4), you started with the wrong values for n and sum1. For sin(pi/4) it should be the fol...

11 years ago | 0

Load more