Réponse apportée
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);

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Please help me in coding of multidimensional array
A = A([1,4,6],[1,4,6]);

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

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

plus de 8 ans il y a | 1

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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)>...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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 = ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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 ...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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)...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 3

Réponse apportée
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 =...

plus de 8 ans il y a | 2

Réponse apportée
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));

plus de 8 ans il y a | 1

| A accepté

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

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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 ...

plus de 8 ans il y a | 2

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 2

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 1

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 1

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 8 ans il y a | 0

Réponse apportée
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;

plus de 8 ans il y a | 8

Réponse apportée
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...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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;

plus de 8 ans il y a | 0

Réponse apportée
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’ ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 8 ans il y a | 1

Réponse apportée
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.

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 9 ans il y a | 0

Charger plus