Answered
Create/choose a rondom point from an existed data matrix?
I will give an answer in terms of a single triangle with vertices at P0, P1, and P2, (either in 2D or 3D.) Define r1 = ra...

10 years ago | 0

| accepted

Answered
I ma trying to do Numerical Integration but getting an error
My guess is that somewhere in your code you have defined another function and given it the name 'integral'. Matlab is confused ...

10 years ago | 0

Answered
for the prime number HW
Same answer as in http://www.mathworks.com/matlabcentral/answers/270893

10 years ago | 0

Answered
for the prime number HW
In answer to the question "Why the for loop ends on sqrt(n) and not on (n)?", a number is not prime if and only if it has at lea...

10 years ago | 2

| accepted

Answered
i have 4 columns of (256x4 double) type.
B = A(:,1:2)+A(:,3:4);

10 years ago | 1

| accepted

Answered
Solving complex non-polynomial system of equations
If you square both sides of your two equations and then multiply the second equation by G+j*omega*C, you then have two polynomia...

10 years ago | 0

Answered
How can I compute expression with an integral?
If the derivative with respect to t is taken of your equation, the result is a differential equation in the dependent variable r...

10 years ago | 0

Answered
What is wrong with this loop?
My guess is that the outer for-loop which changes kn, starting from kn = 1 and ending with kn = 199 is causing unexpected result...

10 years ago | 1

| accepted

Answered
Homework Help, Basic function
Though the statement of the problem doesn't appear to require a computation which uses these inputs, I would think doing so woul...

10 years ago | 0

Answered
How can I generate `n' different sets of `f' unique random numbers between 1 and 120?
m = 120; % Choose m n = 4; % Choose n f = 5; % Choose f A = zeros(n,f); k = 0; while k<n for ix = k+1:...

10 years ago | 0

| accepted

Answered
I would like to create a MATLAB code for this sum
To compute U(i,j) and L(i,j) for each pair i and j, you will presumably have to use matlab's 'fmincon' function in the Optimizat...

10 years ago | 0

| accepted

Answered
poisson function help !
It's hard to understand what you are asking, but perhaps you need to call on the function 'poissrnd' which generates random inte...

10 years ago | 0

Answered
I have a list of triangles of the mesh and point cloud. the question is :how to determine each point belongs to a triangle
Let the points (x1,y1), (x2,y2), and (x3,y3) be the three vertices of a triangle, and let (x,y) be some arbitrary point. Define...

10 years ago | 0

| accepted

Answered
Matrix Indexing from an Array of Numbers
Assuming Z is a row vector Y2 = Y(:,bsxfun(@plus,Z,(0:4).'));

10 years ago | 2

| accepted

Answered
Finding roots of a polynomial with guess and check.
r = roots([1,1,-2]);

10 years ago | 0

Answered
Accuracy of solving a system
There is no hard and fast rule as to the number of significant digits in computations. It depends on the values and the nature ...

10 years ago | 0

Answered
I need to make a set of 2000 random numbers between 0 and 1, with a mean of 0.5, with most of the numbers being either high or low (bimodal distrubution with peaks at 0 and 1)
t = 2*rand(1,2000)-1; x = (sign(t).*sqrt(abs(t))+1)/2; hist(x,20) This should approximate your two linear distribut...

10 years ago | 1

| accepted

Answered
How i can program the following metrics in MATLAB
In the definition of P(j) you have j varying from 1 to n, and therefore j should be the first (row) index of X, X(j,i), and not ...

10 years ago | 0

| accepted

Answered
How to save the output of matrix calculation with different dimension
Based on the fact that you appear to be seeking four index values, I am guessing that what you actually want are the maximum val...

10 years ago | 0

| accepted

Answered
Construct a 2D matrix whose each element is the maximum among the receptive elements of multiple 2D matrices constructed by a 3D matrix.
[B,I] = max(A,[],3); B gives the 2D matrix of maximums along the third dimension and I gives the corresponding 3rd dimensi...

10 years ago | 0

Answered
How to sort an array in descending order and you also have idea about the position to which it descend ?
You can use the second argument produced by 'sort': [B,p] = sort(A,'descend'); q = 1:length(p); q(p) = q; The v...

10 years ago | 0

Answered
Trying to calculate the square root of a positive number based on the “divide and average” scheme.
The line v = (v_pre + t/v_pre)/2.0; is your trouble. It should read: v_pre = (v_pre + t/v_pre)/2.0; However, yo...

10 years ago | 0

| accepted

Answered
Loop Question with divison
For the precise number 0.357, which equals 357/(2^3*5^3), you can never arrive at an exact whole number by repeatedly multiplyin...

10 years ago | 0

| accepted

Answered
If any one can remove the error from this code.when i run this code it is showing the following error
As the error message indicates, you are erroneously using a function handle, namely 'u_xt', as though it were an array that coul...

10 years ago | 0

Answered
How to plot this matrix?
In http://www.mathworks.com/help/matlab/ref/hold.html Mathworks states that for 'hold all' "This syntax will be removed in a fut...

10 years ago | 0

Answered
Why doesn't Procrustes function allow X to have lower number of columns?
Each of the rows in X and Y represent a point in some n-dimensional space, and the number of columns is therefore this dimension...

10 years ago | 0

| accepted

Answered
Why does 10^61 not equal 1e61 in MATLAB?
Matlab uses two different functions for these computations, the exponentiation function for 10^61 and the decimal-to-binary conv...

10 years ago | 0

| accepted

Answered
Error "Unbalanced or unexpected parenthesis or bracket"
The brackets are your problem. For example, the line for A should read: A(i) = (t(i+1) - t(i))/h; However, after you hav...

10 years ago | 0

Load more