Answered
How could I find the integral of a function given this code?
If a is not zero, then “x_t = r_x*(b-a);” is wrong. It should be: x_t = a + r_x*(b-a);

6 years ago | 0

| accepted

Answered
Please help me in coding of multidimensional array
A = A([1,4,6],[1,4,6]);

6 years ago | 0

Answered
How to display two similar functions on a graph?
You could use different 'linespecs' in the plots, say 'y0' on one and 'r*' on the other. If the two sort results are the same, t...

7 years ago | 0

| accepted

Answered
Interest and displaying balance until double the investment?
This is equivalent to evaluating y = ceil(log(2)/log(1.1));

7 years ago | 1

Answered
How can I numerically find a solution of a series of two differential equations.
This is hardly a matlab problem. At an equilibrium you would have the equations: -4*x + 1*y = 0 2*x - 3*y = 0 T...

7 years ago | 0

Answered
Counting Euler Angle Ranges
Assuming your rotation values, ‘r’, are successively indexed by, say, ‘ix’, then use (r(ix-1)<30 | r(ix-1)>60) & r(ix)>...

7 years ago | 1

| accepted

Answered
How to plot y = cos(pi/4)
Choose upper and lower limits of x as a and b. Choose the desired number of plot points as n. x = linspace(a,b,n); y = ...

7 years ago | 0

| accepted

Answered
Summation of Infinity Terms
In the summation symbol ‘m’ is supposed to range over only the odd positive integers. You have it ranging over all positive int...

7 years ago | 0

Answered
Subscripted assignment dimension mismatch
There are quite a few things wrong with this code. 1) In “for i = 1:length(particlePosition)” you will get only three values ...

7 years ago | 1

| accepted

Answered
How to create a matrix that returns max values in each column/row in a vector
How do you want these maxima arranged in your vector result? Here is one possibility. Let M be your matrix. A = [max(M,1)...

7 years ago | 0

Answered
How would I sum a function and use fzero?
Using ‘fzero’ on that particular problem is needlessly inefficient. You can use ‘atan2’ and ‘asin’ instead. cn = cos(t1)+c...

7 years ago | 3

Answered
recursive function hangs after a few steps
The trouble with your recursion is that for an original call with, say, n = 26 it will recursively call on itself twice with n =...

7 years ago | 2

Answered
How to subtract elements in a matrix
You don't need a for-loop. C = nchoosek(1:size(A,2),2); B = A(:,C(:,2))-A(:,C(:,1));

7 years ago | 1

| accepted

Answered
Randomly pair two sets of integers, without repeating the first set?
M = [reshape(set1(randperm(32)),[],1),set2(randi(8,32,1))];

7 years ago | 0

| accepted

Answered
How to find a standard matrix for a transformation?
Assuming the transformation is homogeneous - that is, it leaves the origin fixed - what you have here is six linear equations wi...

7 years ago | 1

| accepted

Answered
Question about using ODE45
(Corrected) Using ‘ode45’ is a very bad idea for this problem. Since dy/dx does not depend on y, this is a simple problem in ...

7 years ago | 2

Answered
Linear system equations - plan intersection?
Each of these equations defines a plane. Their intersection will in general be a single straight line. You can define a straig...

7 years ago | 0

Answered
Non trivial Solutions for a system of equations
Replace a, b, and c with the symbols x, y, and z, respectively: t1*x + y - t1*tm*z = tm t2*x + y - t2*tm*z = tm t3...

7 years ago | 2

| accepted

Answered
Index error when calculating mean of a column
I suspect you have a variable or function somewhere in your code named ‘mean’. If so, you should name it something else so that...

7 years ago | 1

Answered
How to modify loop
There is no single matlab function that will calculate it, but you can make use of the geometrical theorem that the radius of...

7 years ago | 0

Answered
How to randomized a n by m matrix ?
You can use my File Exchange routine “randfixedsum” at: <http://www.mathworks.com/matlabcentral/fileexchange/9700-random-vec...

7 years ago | 1

Answered
Finding the number of numbers above double the standard deviation.
I am guessing that what you really have in mind is the count of those elements which differ from the mean value by more than twi...

7 years ago | 0

| accepted

Answered
I am getting error 'In an assignment A(I) = B, the number of elements in B and I must be the same.' How should I resolve the problem?
With the line Ma(chm) = [a*28.8*4.76] the second time through the for-loop, the ‘chm’ in Ma(chm) will have one element ...

7 years ago | 0

Answered
Put elements into corresponding locations of upper triangular matrix
Let vector ‘inpt’ have size = n*(n+1)/2,1. otpt = zeros(n); otpt(triu(ones(n),0)==1) = inpt;

7 years ago | 8

Answered
finding intersection of two lines?
If your “yellow star point” is as indicated in your diagram, there is a simple formula for finding it which doesn’t require find...

7 years ago | 1

| accepted

Answered
Generate logical vector of specific pattern of numbers
Let n be the number of desired elements in your pattern. t = 1:n; x = (11*t+2+3*mod(t,2))/8;

7 years ago | 0

Answered
how to solve equation like this
Define z = x^(1/6). Then your equation becomes: z^15 + z^2 - 100 = 0 You can solve this numerically using the ‘roots’ ...

7 years ago | 0

| accepted

Answered
Is there have a code to find the radius of curvature of a series of points in 3D
You can make use of the geometrical theorem that the radius of a circumscribing circle of a triangle is equal to the product of ...

7 years ago | 1

Answered
What is meaning of x(x==c1) = 127 ?
It means that every element in array x that equals c1 is replaced by the value 127.

7 years ago | 0

| accepted

Answered
how can i solve equation with summation
If I interpret your code correctly, you are doing things the hard way. Your expression for Pfa is simply the binomial expansion...

7 years ago | 0

Load more