Answered
Paraboloid minimum point always becomes (0,0)
Your problem is with the expression Z = 30*(A.^2) + 4*(B.^2) - 20*(A.*B) + (2.25^2 + 3.25^2 + 3.25^2 + 4.25^2); No matte...

12 years ago | 1

Answered
How to solve this equation which contains gamma function?
I would advise you to use 'fsolve' which is a numerical solver rather than the symbolic solver 'solve'. You are more likely to ...

12 years ago | 1

Answered
How can I sum values at specific point
I have called the larger P array, 'P_large', to distinguish it from the original P. The following code assumes that each elemen...

12 years ago | 1

Answered
How to create a probability tree and calc prob of each branch?
I assume that after the first event the following events occur with the same probabilities as the first events but conditioned o...

12 years ago | 2

Answered
what is the difference between inv() and \ (the backslash) ?
If A is an n x n matrix and B is n x m, solving A\B is tantamount to solving m*n equations in m*n unknowns. Finding the inverse...

12 years ago | 11

Answered
Function fitting given samples and two varying paramters
This appears to be a standard problem for 'fminsearch' or 'fminunc'. The only special feature is that the objective function to...

12 years ago | 1

| accepted

Answered
using ismember to select row
r = find(all(ismember(B,A),2)); The values in 'r' are indices of rows of B consisting entirely of element of A.

12 years ago | 3

| accepted

Answered
How to fill a preallocated matrix with function output?
A(r,:) = [1 2 3 4]; or A(r,:) = 1x4 output of function These place the 1x4 array in the r-th row.

12 years ago | 1

| accepted

Answered
Different results when passing the same value in a function.
You have apparently assumed in your code that 0.015 + 0.0001 gives precisely the same result as 0.0151 . As it turns out, they ...

12 years ago | 1

| accepted

Answered
I am Facing problem using ode45
That is no error. A zero vector is the correct solution to the equations and their zero initial values which you have given the...

12 years ago | 1

| accepted

Answered
"Out of memory" error while inversing a symbolic matrix
Finding the inverse of a square matrix symbolically is a very different proposition from finding it numerically. Just suppose m...

12 years ago | 1

Answered
Determining indices upon which a sequence of real numbers is convex
k1 = k+1-find(diff([x(k+1:-1:1),-inf],2)<=0,'first'); k2 = k-1+find(diff([x(k-1:n),-inf],2)<=0,'first');

12 years ago | 3

| accepted

Answered
Want to plot theoretical curve
The scale factors 1.2254 and 2.3367 in your first theoretical equation have been so chosen that the function f(z) = 1.2254...

12 years ago | 1

Answered
why the error is coming?
It is likely that somewhere in your system you have defined a variable named either 'sum', 'log', 'size', or 'zeros'. If so, th...

12 years ago | 1

Answered
How can I make a column matrix of different sequential elements.
Or perhaps you would like a probabilistic method: n = 20; % Length of desired vector p = 1/4; % Probability of transition ...

12 years ago | 1

Answered
Subscript indices must either be real positive integers or logicals
Very likely you have a variable in your system called 'corr' which conflicts with the matlab function of the same name.

12 years ago | 3

| accepted

Answered
counting number of times commadn executed in while loop
FinalValue = Investment; Count = 0; while FinalValue < 2*Investment; FinalValue = FinalValue + Rate*FinalValu...

12 years ago | 1

Answered
Sum of geometric series without loop
A simpler method: result = (1-r^(n+1))/(1-r);

12 years ago | 2

Answered
MATLAB error: Subscript indices must either be real positive integers or logicals
As you have defined X_SS it is a single scalar quantity: X_SS = y(1). Consequently length(X_SS)-1 is 0 and therefore HIVinf1 wi...

12 years ago | 1

| accepted

Answered
Writing a simple funtion
The 'ceil' and 'floor' are used here in case the inputs are not integers. function s = sumintegers(a,b) if a <= b ...

12 years ago | 1

Answered
How to calculate this infinite sum?
Thanks to Leonhard Euler we can express atan(z) as the infinite series: atan(z) = symsum(2^(2*n)*(n!)^2/(2*n+1)!*z^(2*n+1)...

12 years ago | 2

| accepted

Answered
How to minimize a complicated function?
In your statement, "I want to minimize this function to find UT", do you mean that you want to so adjust the matrix 'UT' that th...

12 years ago | 3

Answered
Newton-Raphson Method for Non-linear System of 3 variables in Matlab
I do see an error in your code, though it does not account for why you get only one iteration. You are not renewing the value o...

12 years ago | 1

| accepted

Answered
Need help to solve and plot implicit diode equation
An explicit solution for I as a function of V can be found using matlab's 'solve'. The solution involves the 'lambertw' functio...

12 years ago | 1

Answered
Permute/Rearrange/Shuffle the elements of a matrix
With n = 5 rows in A you would get 14,400 different B matrices and that is too many to dream up names for, so I have put them al...

12 years ago | 1

Answered
using fsolve to solve the golden ratio equation, the numerical solution have a extraneous root,but it displays -1,why?
If you make a plot of your 'f' function, it is possible to see why 'fsolve' gets into trouble with the initial estimate of x = -...

12 years ago | 3

Answered
Fixing the root of polynomial
Presumably you are using matlab's 'roots' function, which for fourth degree polynomials will give four roots, so your task is to...

12 years ago | 1

| accepted

Answered
Sum every i-th column in matrix seperately
S = sum(C(:,i:i:end),1); This results in a row vector, S, consisting of the sum of every i-th column of C, as requested. ...

12 years ago | 1

Answered
integration of (1/x-x)^alpha
Yes, you are right, Camille. If alpha < 1, your function is integrable, but the infinity in its integrand at x = 0 is apparentl...

12 years ago | 2

| accepted

Load more