Answered
Selection Sort FUNCTION help in understanding it
(Corrected) Starting with i = 1 and ending with n-1, the first line finds the index of the minimum element in A from i to n, an...

6 years ago | 1

| accepted

Answered
Error using vertcat - dimensions of matrices being concatenated are not consistent
In W you are asking that it have three rows, the first one with 56 elements, the second with only 37, and the third with 16. Th...

6 years ago | 0

Answered
Equation solution for large iteration number
Assuming you have the ‘lambertw’ function on your Matlab system: d = a./b; e1 = exp(1); y = zeros(1,18858); for ix...

6 years ago | 0

| accepted

Answered
insert vector between two points
t = [t(1:3);s;t(4:6)];

6 years ago | 0

Answered
how get the solution of three nonlinear equation and three unknowns on MATLAB?
In the second equation you can easily, by hand, solve for x in terms of z. In the third equation you can do likewise with y in ...

6 years ago | 1

Answered
Vectorization of a double for loop
You can save unneeded repetition by computing one of the factors outside the loop. BL1 = zeros(M+N-1); T = (1:M+N-1)'; ...

6 years ago | 0

Answered
Vectorization of a double for loop
The following code should correct the error in my first answer. This version also avoids the repetition involved in your code f...

6 years ago | 0

| accepted

Answered
How can i iteratively reduce the value of particular matrix elements?
Everything that happens in each trip through your for-loop depends on the matrices B and C, and yet B and C remain unchanged. T...

6 years ago | 0

| accepted

Answered
Why do I get the wrong value when I try to evaluate log([-1;1]) this way?
Both answers are correct for log(-1). In fact there are infinitely many possible correct answers of the form (2*n+1)*pi*i for a...

6 years ago | 1

Answered
Finding the point of intersection of two lines in 3D space.
What is so difficult about substituting your parameter solutions into the expressions, ‘A+t*BA’ and ‘C+s*DC’? Note that if the ...

6 years ago | 0

Answered
Plotting multiple numerical solutions of a non-polynomial equation
One possibility is to use ‘fsolve’ on the two equations. You will need to give initial starting values for ‘m’ and ‘b’, and by ...

6 years ago | 0

Answered
Is these two conditions okay? sentence if
It is syntactically correct, but impossible to satisfy. You are asking the variable qb to simultaneously be equal to 2 and to 4...

6 years ago | 0

| accepted

Answered
Editing Figure to Create Equilateral Triangle
If (x1,y1) and (x2,y2) are any two points, then a third point defined by: (x1+x2-sqrt(3)*(y2-y1))/2,(y1+y2+sqrt(3)*(x2-x1))...

6 years ago | 0

Answered
How to generate random number within a sum limit?
If the numbers are supposed to be any five positive integers, do this: b = true; while b x = 50*randi(5,1); b ...

6 years ago | 0

Answered
Question with rotating 2d vectors.
(Corrected - At first erroneously I rotated in clockwise direction) r = 50; wr = w*cosd(r)-z*sind(r); zr = w*sind(...

6 years ago | 0

| accepted

Answered
How do I find the max value over specific intervals of a column vector?
mx = max(reshape(M,10,[]),[],1);

6 years ago | 1

Answered
Find the distance of a point from a line in an image.
If A and B are coordinate vectors of two points on your line, and C is the vector of another point, the orthogonal distance of p...

6 years ago | 0

Answered
Program error!! Why??
In bestframeidx = frameidx_history(maxbrigthnessidx); you misspell 'maxbrigthnessidx'. The 't' and 'h' are interchange...

6 years ago | 0

Answered
how to calculate angle from coordinate
If A, B, and C are three points in two-dimensional space defined by 1 x 2 coordinate row vectors, here’s the way I like to compu...

6 years ago | 0

| accepted

Answered
How can I compare if it is a matrix is 3x2? in if or switch statement
if all(size(m)==[3,2])

6 years ago | 0

| accepted

Answered
Compute double sum or double integral throug sum
[X,Y] = meshgrid(x,y); M = -3*exp(-sqrt(X.^2+Y.^2)/2); S = sum(M(:))*.2*.2; % The desired sum

6 years ago | 1

Answered
Proportional change of values with a fixed sum
To put your problem in general terms, suppose you have a row vector of values, v, with some given sum. For the i-th element you...

6 years ago | 1

| accepted

Answered
WHY THIS SIMPLE CODE IS NOT WORKING? please help
This code ought to work. Perhaps you have a variable somewhere in your system named ‘mod’. That would mess things up.

6 years ago | 0

| accepted

Answered
matrix arrangement problem for loop
a = reshape(a,4,[]).';

6 years ago | 0

| accepted

Answered
Moving points around a line
I assume that by “to transfer this coordinates along the line” you mean you wish to project each such point in the “shape” ortho...

6 years ago | 1

Answered
Can anyone explain to me what is happening in this 'for' loop?
The “for i=A” line is the source of oddity for your code. It should ordinarily be a row vector - that is, having only one row. ...

6 years ago | 1

| accepted

Answered
I want to write a Matlab function that will convert a decimal number into a binary number.
This is a function I wrote for my own edification. Perhaps you can make use of it. It converts a single scalar 'double' to a str...

6 years ago | 1

| accepted

Answered
I have a problem about below question. Cab anybody help me??
You have only the sum of the four corners of the matrix. Hint: A(1,:) is a vector consisting of the top row elements of A. How...

6 years ago | 0

| accepted

Answered
cov computation in Matlab
The 'cov' function normalizes by dividing by N-1 where N is the number of observations, which in this case is the number of rows...

6 years ago | 0

| accepted

Load more