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

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 1

| akzeptiert

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

mehr als 11 Jahre vor | 2

| akzeptiert

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

mehr als 11 Jahre vor | 10

| akzeptiert

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 2

| akzeptiert

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

mehr als 11 Jahre vor | 1

| akzeptiert

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

mehr als 11 Jahre vor | 0

| akzeptiert

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 2

| akzeptiert

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

mehr als 11 Jahre vor | 3

| akzeptiert

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

mehr als 11 Jahre vor | 1

| akzeptiert

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

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 2

| akzeptiert

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

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 5

| akzeptiert

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

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 1

| akzeptiert

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

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 1

| akzeptiert

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 3

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

mehr als 11 Jahre vor | 2

Mehr laden