Beantwortet
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);

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 0

Beantwortet
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...

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 1

Beantwortet
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...

mehr als 8 Jahre vor | 0

Beantwortet
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)>...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
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 = ...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 8 Jahre vor | 0

Beantwortet
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 ...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
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)...

mehr als 8 Jahre vor | 0

Beantwortet
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...

mehr als 8 Jahre vor | 3

Beantwortet
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 =...

mehr als 8 Jahre vor | 2

Beantwortet
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));

mehr als 8 Jahre vor | 1

| akzeptiert

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

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
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 ...

mehr als 8 Jahre vor | 2

Beantwortet
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...

mehr als 8 Jahre vor | 0

Beantwortet
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...

mehr als 8 Jahre vor | 2

| akzeptiert

Beantwortet
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...

mehr als 8 Jahre vor | 1

Beantwortet
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...

mehr als 8 Jahre vor | 0

Beantwortet
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...

mehr als 8 Jahre vor | 1

Beantwortet
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...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

mehr als 8 Jahre vor | 0

Beantwortet
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;

mehr als 8 Jahre vor | 8

Beantwortet
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...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
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;

mehr als 8 Jahre vor | 0

Beantwortet
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’ ...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

mehr als 8 Jahre vor | 1

Beantwortet
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.

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 8 Jahre vor | 0

Mehr laden