Réponse apportée
how to rewrite f(x,y)=0 as y=...
This equation can be manipulated so that y is the solution to a twelfth-order polynomial in y with coefficients in terms of x. ...

plus de 9 ans il y a | 2

Réponse apportée
Hi.I want to multiply n matrices with k,k+1 dimension and the problem is that if I test the code on paper it seems right but written on matlab well it's a little bit different. here is the code :
All you are going to get with this computation is the first row of the product of these A{...} matrices. The result will theref...

plus de 9 ans il y a | 0

Réponse apportée
How to 'carry' matrix index with matrix operations
Use the second quantity returned by the 'sort' function: [b,p] = sort(a); The 'p' is an index for rearranging the first...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
find few elements in vector
[~,ia] = intersect(y,x); ia contains indices with respect to y of elements that lie both in y and in x.

plus de 9 ans il y a | 0

Réponse apportée
Straight line in 3D between endpoints of x, y, z data. Extract coordinates of straight line in specified positions.
Suppose P1 = [x1;y1;z1] and Pn = [xn;yn;zn] are the endpoints and Pm = [xm;ym;zm] is an intermediate point, each represented as ...

plus de 9 ans il y a | 1

Réponse apportée
random number with fixed summation
Use the ‘randperm’ function on each column of f1: f1 = zeros(8,11) for ix = 1:size(f1,2) f1(randperm(size(f1,1),...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
MATLAB help with function and while loop?
I see at least four difficulties in your code: a) You shouldn’t use the word ‘sum’ for a variable. Matlab has a function by ...

plus de 9 ans il y a | 0

Réponse apportée
Why do I get this error: A(I): index out of bounds; value 2 out of bound 1 (line 13)
Besides the error that Daniel gives you, another error is that ’n’ never changes within your while-loop, so the (corrected) loop...

plus de 9 ans il y a | 0

Réponse apportée
Double integral error Matrix dimensions must agree
1. In the expression for ‘p2’ you have “t/tau” which is matrix division. However the sizes of ’t’ and ‘tau’ are incompatible wi...

plus de 9 ans il y a | 0

Réponse apportée
I need to write an if statement that says "if variable userValue is equal to the square root of any negative number, then...". The number could be any number you input into the function. How would I do this?
The square root of a real negative number is pure imaginary, so its real part must be zero. Just test that real(s) is zero wher...

plus de 9 ans il y a | 0

Réponse apportée
while loop won't run?
I am guessing that you need to change the initial ‘Error’ to: Error = abs(Qdotpv-QHdot); %W As you have it, if the erro...

plus de 9 ans il y a | 0

Réponse apportée
Estimating pi using while loop for specific tolerence.
The difference between the finite sum 1+1/4+1/9+...+1/N^2 and the infinite sum is proportional to 1/N. Therefore each time you ...

plus de 9 ans il y a | 0

Réponse apportée
What is MATLAB's algorithm for calculating integral error?
Obviously Matlab’s ‘integral’ function cannot know the exact value of the given integral since it is limited to a finite number ...

plus de 9 ans il y a | 0

Réponse apportée
How can I iteratively solve an algebraic equation?
My primitive version of ‘solve’ gives a non-iterative solution for x in terms of the “lambertw” function: x = -200/9*(9/50*...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
Combinations of a single vector
You can use ‘nchoosek’ for that task: C = nchoosek(a,2);

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
Secant method error, "subscript indicies must be real or positive integers"
You enter the while loop with n = 1. This means that x(n-1) would have an index value of zero. This is a no-no in Matlab. You...

plus de 9 ans il y a | 0

Réponse apportée
Calculating normal on a plane: Can't get proper results
You should not be requiring an exact zero for those dot products, since in most circumstances your computations will involve rou...

plus de 9 ans il y a | 2

| A accepté

Réponse apportée
Cumsum gives different results for double and single
Yes, that is very easily explained. The computations for vector ‘b’ are performed with single precision accuracy, whereas those...

plus de 9 ans il y a | 1

Réponse apportée
solving an equation in matlab
I understand that you want to determine the values of Fi in your first RG expression, given m and the coefficients of an equival...

plus de 9 ans il y a | 0

Réponse apportée
I am trying to solve this system of linear equations but for some reason I keep getting 0 for the variables and I'm not sure what I am doing wrong
I see one problem. The resulting set of four equations in four unknowns is not linearly independent and therefore has infinitel...

plus de 9 ans il y a | 0

Réponse apportée
covariance matrix from a random vector?
With just a vector, Y, you can calculate its variance but there is no significance to calculating its covariance. That would al...

plus de 9 ans il y a | 0

Réponse apportée
Why am I getting an array of NaN when using icdf?
The ‘icdf’ function computes the inverse of a cdf function, which means that it receives a probability value or values and obtai...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
Determine the roots of the simultaneous nonlinear equation by fixed point iterations
Using your “fixed point” iteration method to solve those two equations is a bad idea. There are much simpler ways of solving su...

plus de 9 ans il y a | 0

Réponse apportée
Finding Closest Data Point
I recommend you use the ‘pdist2’ function using the “Smallest” option. It is described at: https://www.mathworks.com/help...

plus de 9 ans il y a | 1

Réponse apportée
Maximum recursion limit of 500 reached error in matlab.
The code for ‘randfixedsum’ was written to have each column, not each row, of the resulting matrix x have the given sum s. If y...

plus de 9 ans il y a | 0

Réponse apportée
If my K matrix is [17X17] and I want to divide it by a column matrix F=[17X1] how do I do that?
I believe the most likely division you are asking for would divide element-wise the elements of each column of K by those of the...

plus de 9 ans il y a | 0

Réponse apportée
Why is my Plot Blank?
You need to index dyds so that it contains a value for each value of ‘theta’: dyds = zeros(1,length(theta)); for k = 1:l...

plus de 9 ans il y a | 0

Réponse apportée
Solving an implicit equation for y error
You don’t need ’solve’ for solving for y. It can be obtained in the following equation: y = ∓sqrt(x^7*exp(5*C)/5-4/5*x^2)...

plus de 9 ans il y a | 0

Réponse apportée
h = mod(prod(uint8('Welcome42')),2^24-3); returns the wrong result ?
The product, prod(u​int8(‘Welc​ome42’)), is too large an integer to be represented exactly with the 53 bits available for a ‘dou...

plus de 9 ans il y a | 2

Charger plus