답변 있음
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);

8년 초과 전 | 0

| 수락됨

답변 있음
Please help me in coding of multidimensional array
A = A([1,4,6],[1,4,6]);

8년 초과 전 | 0

답변 있음
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...

8년 초과 전 | 0

| 수락됨

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

8년 초과 전 | 1

답변 있음
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...

8년 초과 전 | 0

답변 있음
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)>...

8년 초과 전 | 1

| 수락됨

답변 있음
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 = ...

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 0

답변 있음
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 ...

8년 초과 전 | 1

| 수락됨

답변 있음
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)...

8년 초과 전 | 0

답변 있음
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...

8년 초과 전 | 3

답변 있음
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 =...

8년 초과 전 | 2

답변 있음
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));

8년 초과 전 | 1

| 수락됨

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

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 1

| 수락됨

답변 있음
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 ...

8년 초과 전 | 2

답변 있음
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...

8년 초과 전 | 0

답변 있음
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...

8년 초과 전 | 2

| 수락됨

답변 있음
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...

8년 초과 전 | 1

답변 있음
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...

8년 초과 전 | 0

답변 있음
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...

8년 초과 전 | 1

답변 있음
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...

8년 초과 전 | 0

| 수락됨

답변 있음
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 ...

8년 초과 전 | 0

답변 있음
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;

거의 9년 전 | 8

답변 있음
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...

거의 9년 전 | 1

| 수락됨

답변 있음
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;

거의 9년 전 | 0

답변 있음
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’ ...

거의 9년 전 | 0

| 수락됨

답변 있음
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 ...

거의 9년 전 | 1

답변 있음
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.

거의 9년 전 | 0

| 수락됨

답변 있음
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...

거의 9년 전 | 0

더 보기