Answered
How to sum two rows in a matrix?
b = sum(reshape(a.',2*size(a,2),[]),1).'; % Assume an even no. of rows

12 years ago | 0

Answered
how can i solve these equations to get the variables??
I see no reason to believe that the iterative procedure you have set up will necessarily converge. You were lucky with B(i) and...

12 years ago | 0

Answered
How to fix this error: Attempted to access x(84); index out of bounds because numel(x)=83.
I think your trouble is with the way you call on what you call 'randsign'. You state that "The 'randsign' function randomly spi...

12 years ago | 0

| accepted

Answered
Code review: Inputing coordinates and calculating triangle parameters.
1) The area formula has an error. The first factor should be s, not a. 2) There is a somewhat more robust area formula using...

12 years ago | 0

Answered
std for a growing data range
n = (1:size(data,1))'*size(data,2); sq = cumsum(sum(data.^2,2)); sm = cumsum(sum(data,2)); rsStd = sqrt((sq-sm.^2./n)./(n...

12 years ago | 1

| accepted

Answered
Simultaneously Solving 12 unknowns with 12 equations
At a glance, these are all linear equations in the twelve unknowns. If so, form the 12 x 12 matrix of coefficients and use matl...

12 years ago | 1

Answered
Creating Matrix using nested for loop?
How about C = [3;4;7]*(1:5); or C = zeros(3,5); for r = [3,4,7] for c = 1:5 C(r,c) = r*c; end end ...

12 years ago | 1

Answered
Problem with the find function
I would guess offhand that when the 'find' function happens to come up empty at klow(i)=find (temps >=t2(i),1,'first'); ...

12 years ago | 0

Answered
For Error: ??? Index exceeds matrix dimensions.
I rather think your trouble is caused by the way you indexed the array 'x1Firstrow16'. Its rows are successively indexed as: ...

12 years ago | 0

Answered
How can i write a matlab code for making 3 digits pairs from a given binary sequence. and to store that pairs in a array for further use
Consult the documentation for matlab's 'reshape' function at: http://www.mathworks.com/help/matlab/ref/reshape.html

12 years ago | 2

Answered
convert inf value to integer value
John's function 'powermod' is a very efficient method of solving your problem, but it is possible to solve it in such a way that...

12 years ago | 0

Answered
How do you program CLT?
Bill, this seems like a rather straightforward assignment, demonstrating the famous central limit theorem. In what respect are ...

12 years ago | 1

| accepted

Answered
how can i change the interval of rand?
I will first respond to the code you wrote which normalizes the sum of your eight-element rows to one. This code can easily be ...

12 years ago | 2

Answered
pl find a solution to integration in matlab
This has the appearance of a function for which there is no known explicit integral, and consequently you need to use numerical ...

12 years ago | 1

Answered
Is it possible to phase unwrap backwards??
The 'unwrap' function accepts the phase angle of the first element in its vector and corrects from there on to the end of the ve...

12 years ago | 1

Answered
How to rotate entire 3d data with x,y,z values along a particular axis (say x axis)?
Let X,Y,Z be arrays of the rotated points in the dataset. For rotation along the x-axis: X = x; Y = y*cos(p)-z*sin(p); ...

12 years ago | 7

| accepted

Answered
could you help me to write this formula in matlap ,and to get it's code ??
That's convolution. Look up the documentation for the matlab function 'conv'. http://www.mathworks.com/help/matlab/ref/conv....

12 years ago | 2

Answered
How to create a symmetric random matrix?
Let the random matrix to be generated be called M and its size be NxN. d = 1000000*rand(N,1); % The diagonal values t ...

12 years ago | 2

| accepted

Answered
Multiple Integrals Without Using Symbolic
To my knowledge, 'integral2' is incapable of handling this kind of problem. Instead it will be necessary for you to write a fun...

12 years ago | 0

Answered
Function to evaluate arguments using pol2cart
Think about how the real and imaginary parts of any complex number are related to its magnitude and angle, and you will have jus...

12 years ago | 0

Answered
how to reorder the elements of a matrix
Here's a one-liner, though it doesn't exhibit the ingenuity that Star's does. A = A([16,12,15,14;11,8,4,7;10,13,9,6;3,2,5,1...

12 years ago | 2

Answered
Question regards double integral
Writing "ymax=x;" doesn't do the job. If 'ymax' is not a scalar value, it needs to be a 'function handle'. The same applies to...

12 years ago | 0

Answered
Hello, I am receiving an error when attempting to build a matrix. The error and the code is pasted below.
In the line XPriorEst=XEst; the variable 'XPriorEst' is made equal to an entire 1x10 array. When it is used in the lin...

12 years ago | 1

Answered
Integration the product of two data sets
You cannot use 'trapz' on the two sets of data as they stand. To get an accurate integral of the product, the two factors must ...

12 years ago | 1

Answered
Solving Nonlinear Equations using Newton-Raphson Method
The recursion works very much the way it would in one dimension except that instead of dividing by the function's derivative, yo...

12 years ago | 0

Answered
how can I use matlab to solve this probability problem?
That's the kind of problem that can be solved mentally faster than a program can be written to do it. So why bother using matla...

12 years ago | 1

Answered
I want to gather points in triangle and stokes
@bil bbil: After consulting your prior question #122689, "how to store all the results in a table with index", it would appear t...

12 years ago | 2

| accepted

Answered
How to calculate the perimeter and area of a polygon?
Yes, that is what is meant by a "vectorized" expression. However the sign of your area is now the opposite of the sign of your ...

12 years ago | 0

Answered
How to calculate the perimeter and area of a polygon?
The perimeter looks right, but to make the area right either the first point must equal the last point or you need to extend the...

12 years ago | 1

| accepted

Answered
how to integrate a function whose values are represented by a set of data points at time t instead of continuous function of time t
*"I guess I cannot use the existing Matlab commands like 'int' etc. Any suggestions?"* That is correct. You must use a functio...

12 years ago | 0

Load more