Answered
how to find the equation that best fit this curve
The right side of this curve looks as though it is asymptotically approaching a descending straight line. The left side doesn't...

11 years ago | 2

Answered
how to draw piecewise hermite curve.
Here's how to draw one "piece". Let (x1,y1) and (x2,y2) be the coordinates of the two end points and m1 and m2 the respective d...

11 years ago | 2

Answered
Translating Trig Expressions into Code
Your formula is only a valid approximation if the two delta's are small and are measured in degrees. Also theta must be the lat...

11 years ago | 0

Answered
Clever solution sought: Summing values from an array into a vector component given in a second array
You might try using accumarray: A = accumarray(indArray(:),valArray(:),[M,1]);

11 years ago | 1

Answered
binocdf function apparently not functioning with very small numbers (near 1e-15)
Your problem is one of accuracy at the upper end. You have written: usk = 1 - binocdf(k,n,(1/factorial(s))); so that a s...

12 years ago | 2

| accepted

Answered
Randomise the upper triangle of a matrix
If you are going to do this randomization 10000 times, you would want it to be as efficient as possible. Here is a possible way...

12 years ago | 4

| accepted

Answered
Quad error, simple function,
Your function definition is lacking operators in at least four places, one after "cpn(2)", one after "cpn(4)", and one before ea...

12 years ago | 1

Answered
Probablity distribution calculation for a vector
From the documentation for normpdf at http://www.mathworks.com/help/stats/normpdf.html *"Y = normpdf(X,mu,sigma) computes...

12 years ago | 1

Answered
Does this formula wrote in correct way in the matlab
At the right end of your formula, ".√(E²-m²)", are you sure the dot signifies multiplication? If it were to mean that, as I hav...

12 years ago | 2

Answered
Please help me to modify the following program
[~,p] = sort(rand(n-1,d)); A = accumarray([reshape(p+(p>=T),[],1),repmat([1:S-1,S+1:n]',d,1)],1,[n,n]); A(1:n+1:n^2) = 0;

12 years ago | 3

| accepted

Answered
can anyone explain, how following program is working?(5th step)
If you prefer vectorized solutions, I could just as well have put the solution in this form: [~,p] = sort(rand(4,7)); A = ...

12 years ago | 0

Answered
can anyone explain, how following program is working?(5th step)
The 'randperm' function is generating random permutations of the sequence, 1,2,3,4. For example suppose it generate p = 4,3,1,2...

12 years ago | 3

| accepted

Answered
how can i solve the matlab warning message
The range of integration you are using, 0 to 0.693, includes values which lie inside the interval, -m < x < +m, and that will gi...

12 years ago | 2

| accepted

Answered
How i can create random array with fixed sum for each row and column?
I assume by _"rounded off"_ you mean the elements are all to be integers. Do this: A = zeros(4); for k = 1:7 p = rand...

12 years ago | 3

| accepted

Answered
Reflect a triangle given a mirror line
I suggest you look at John D'Errico's advice on this kind or problem at: https://www.mathworks.com/matlabcentral/newsreader/...

12 years ago | 0

Answered
Taylor series sum and factorial
Here is a method that doesn't require the 'factorial' function. See if you can figure out why this is equivalent to the formula...

12 years ago | 1

Answered
Symbolic equation is too long to be displayed.
Your 25000-plus-character result demonstrates the perils of attempting to always obtain a single symbolic expression as the solu...

12 years ago | 1

| accepted

Answered
How to solve an equation with term beyond realmax?
The following is a somewhat improved version of my previous answer. It guarantees that you will not get a NaN for the product o...

12 years ago | 2

| accepted

Answered
How to solve an equation with term beyond realmax?
Your trouble would occur when both B and C are too large. In your function which evaluates the product exp(B)*erfc(C) you could...

12 years ago | 5

Answered
How can I generate a predefined matrix of desired dimensions from the following code?
*"But how to set another dimension?"* Your question isn't clear to me. The number of columns in A after the operation by 'orth...

12 years ago | 1

Answered
Find row with NaN in it.
The code t = any(isnan(X),2); will return you a column vector of logicals in which each element is true if the correspo...

12 years ago | 3

Answered
Tube-Plot with x-y-Coordinates and radius
Let P1 and P2 be 1 x 3 row vectors of the x, y, z coordinates of two points along your line and let r be the desired radius. ...

12 years ago | 2

Answered
solving a non-linear problem
By appropriate algebraic manipulations you can reduce your (corrected) seven equations to finding the solution of a single equat...

12 years ago | 3

Answered
how can i write a matlab code for the summation below? please help
For x,y points near the edges of the plate, to preserve accuracy, it is necessary to sum the series in odd values of n up to a v...

12 years ago | 2

Answered
solving a non-linear problem
In spite of your claim of seven equations you have given only six of them, which are not enough to uniquely determine the seven ...

12 years ago | 3

Answered
Empty system, 1 equation 1 unknow with solve
The function 'solve' is intended to find symbolic solutions to equations. There is no guarantee that it will succeed. If it fa...

12 years ago | 2

Answered
cross correlation matrix dimension
The nested for-loops are not doing what you appear to have in mind. You are doing a summation on scalars there. Also some of t...

12 years ago | 1

Answered
Minimization of a integration function
In general for minimization problems with constraints you should use 'fmincon'.

12 years ago | 2

Answered
A VERY slow Matlab code!
In the inner two for-loops you have ordinary matrix multiplication. You should make use of it. function du = odefungPC(u,Di...

12 years ago | 4

| accepted

Answered
Minimization of a integration function
There can be no finite minimum to this objective function. The more negative you make xa, the more the integral decreases. Min...

12 years ago | 1

Load more