답변 있음
subtract two identical float number it gives a very small number not a zero
Matlab's double precision numbers are in binary form, and therefore cannot represent the quantity 0.9500 exactly. Using binary ...

11년 초과 전 | 1

답변 있음
Graph intersection of 3 curves
Use 'roots' on the cubic polynomial difference between y1 and y2 to get the three intersections of the y1 and y2 curves. Simila...

11년 초과 전 | 1

답변 있음
How can this code run through all possible combinations of numbers in two separate arrays?
Use for-loops: for iA = 1:length(A) a = A(iA); for iB = 1:length(B) b = B(ib); % Use a and b a...

11년 초과 전 | 0

답변 있음
a problem about integration
Just in case it is of interest to you, here is that infinite series expansion of your integral which I referred to: -2*pi*((...

11년 초과 전 | 1

| 수락됨

답변 있음
In a for loop matrix dimension changes?
If 'SWfunction' produces a scalar value, then 'w' will be a scalar, that is 1 x 1, since it is being overwritten 400 times in yo...

11년 초과 전 | 2

| 수락됨

답변 있음
How to give ranking from highest to lowest
This should give you the rank you are asking for, Mekala: [~,p] = sort(Data,'descend'); r = 1:length(Data); r(p) =...

11년 초과 전 | 10

| 수락됨

답변 있음
how to populate the left side with the same values as the right side in an array
t = 1:floor(n/2); P(:,t) = P(:,n+1-t);

11년 초과 전 | 0

답변 있음
problems with plotting density function
In terms of the numerical quantities matlab is dealing with, it is not possible to define a probability density for a discrete-v...

11년 초과 전 | 2

| 수락됨

답변 있음
Question about for construct?
You shouldn't have to actually activate those 'for-loops' to determine how many times they will execute. You can do it in your ...

11년 초과 전 | 1

| 수락됨

답변 있음
How can I plot values of a for loop?
In your for loop you are not placing the successive values of Tc and Q in vectors. Instead they are being overwritten so that o...

11년 초과 전 | 0

| 수락됨

답변 있음
matlab triple integral conical gravity
I have a very ancient version of the Symbolic Toolbox, but it has trouble with substituting z for (z^2)^(1/2) if you integrate w...

11년 초과 전 | 0

답변 있음
Generate Random Numbers such that Sum of their Squares is 1 ???
If you drop any requirement of having a "normal" distribution, you can do this: x = randn(n,1); x = x/sqrt(sum(x.^2));...

11년 초과 전 | 0

답변 있음
How to get the accurate coordinate value of the point on a fitted contour? And how to integrate along the contour?
You can obtain a two-row matrix, C, from your call to 'contour' which contains x,y coordinates for points along contours: ...

11년 초과 전 | 2

| 수락됨

답변 있음
How to calculate the orientation/angle of a 3D gradient.
I did in fact look at equation (1) of the article you referenced, R Bruggink. If that is the computation you are asking about, ...

11년 초과 전 | 3

| 수락됨

답변 있음
I need help with this > mx ̈+b(x ) ̇+k(x^3+∝x)=0 with I.c. x(0)=1 and x ̇(0) =0
The following website documents the numerical differential equations solvers. Read it carefully. It can solve your problem. ...

11년 초과 전 | 1

| 수락됨

답변 있음
What is missing in this code to solve the problem?
If your image shows the code you tried, then here are some objections I have: 1) The defined function 'fal' needs to be termi...

11년 초과 전 | 1

답변 있음
Product of two real numbers gives (sometimes!) a complex number?
In your computation you are assuming that multiplication with floating point numbers always obeys the associative law of multipl...

11년 초과 전 | 2

| 수락됨

답변 있음
How do I solve solve an equation for the first complex root?
This is a quadratic equation of the form "a*x^2+b*x+c=0" with complex-valued coefficients, b and c. The same formula as for rea...

11년 초과 전 | 1

답변 있음
How to apply velocity + acceleration to a position?
You can approach this problem two ways. One is symbolic and other is numeric. As you are probably aware, you have two entirely...

11년 초과 전 | 1

답변 있음
matlab program help looping over t and the indices of a matrix to fill in entries
When you get to the third row where k = 3 and where t has ascended to 1500, the value of sinh(((2*t)-1)*pi*(k-1)/20) i...

11년 초과 전 | 1

답변 있음
Select everything NOT returned by index
You can always do logical indexing using the negation of whatever condition you have. t = wind(:,:,1)>0&wind(:,:,2)>0; ...

11년 초과 전 | 5

| 수락됨

답변 있음
How do I use of "trapz" for numerical integration?
The quantity which you have designated as 'r1' in the call to 'trapz' is meant to represent the variable of integration, and as ...

11년 초과 전 | 1

답변 있음
How can I permute a 3D magic matrix such that the largest element will be on page 3.
By "permutation" I assume you mean a permutation among the 3D pages. [~,ind] = max(A(:)); [~,~,i3] = ind2sub(size(A),i...

11년 초과 전 | 1

| 수락됨

답변 있음
How to solve multiple equations
Consult these two sites carefully: http://www.mathworks.com/help/symbolic/syms.html http://www.mathworks.com/help/symb...

11년 초과 전 | 1

답변 있음
Triple integral using integral3
The 'integral3' function performs numerical integration for which numerical values must be supplied. The form of your code look...

11년 초과 전 | 1

답변 있음
How do i setup for this function?
If we call d = Y-X, by plotting d as a function of Kbf it is immediately evident that Kbf attains a minimum when d is zero. (St...

11년 초과 전 | 1

| 수락됨

답변 있음
How to select randomly among all positive value in a matrix
If I understand you correctly, do this: f = find([m;m2m]>0); % Find all positive value in either array i1 = f(randi(n...

11년 초과 전 | 0

답변 있음
??? Indexing cannot yield multiple results. [u s v]=svd(a);
By any chance do you have a variable named 'svd'? If so, you should change its name so as not to be confused with matlab's 'svd...

11년 초과 전 | 1

답변 있음
how to integrate implicitly in matlab
I presume by "implicitly" you mean, given the value of the integral, you are to find the necessary upper limit of integration (o...

11년 초과 전 | 3

답변 있음
create a binary sequence that consisting of m zeros and n ones in any order.
Or perhaps you want them in random order: x = zeros(1,m+n); p = randperm(1:m+n,n); x(p) = ones(1,n);

11년 초과 전 | 2

더 보기