Answered
"In an assignment A(I) = B, the number of elements in B and I must be the same."
In the first for-loop you have a 1000-element vector on the right side because of the two "randn(M,1)" which is to be assigned t...

12 years ago | 0

Answered
how do I compare columns in a string matrix
Instead of that inner for-loop with the index jj, use the 'all' function: palRes(ii) = all(wordList(ii)==fliplr(wordList(ii)...

12 years ago | 0

| accepted

Answered
matrix and vector multiplication without for loop
G = X.'*Y;

12 years ago | 3

Answered
About double integral which includes non-linear equations in it
The symbolic toolbox is quite capable of solving your double integral. For simplicity of notation I substituted a = Le/2, b = -...

12 years ago | 0

| accepted

Answered
Why is my Simpson's 3/8 code not producing the correct values?
The upper limits in the first two for-loops are not right. They should be: for i = 1:3:n-2 x(i) = a + h*i; S = S...

12 years ago | 2

| accepted

Answered
Solving for unisolated variable
Two solutions can be expressed as: x = asin(A/sqrt(B^2+C^2)) - atan2(C,B); and x = pi - asin(A/sqrt(B^2+C^2)) - atan2...

12 years ago | 0

Answered
If you give Matlab a set of points and perimeters can it give you an equation?
You could also use a fifth order Lagrange polynomial to go through all six points. See: http://en.wikipedia.org/wiki/Lagran...

12 years ago | 0

Answered
How do I either loop or iterate the variable?
Your loop is not working for a number of reasons. Is the following what you have in mind?: n = 30; r = 0.2; x = zeros(1...

12 years ago | 0

Answered
Index exceeds matrix dimensions error
Judging by the line "mycolours=jet(6)", 'mycolours' would be a scalar variable, and yet you attempt to index it with "mycolours(...

12 years ago | 0

Answered
How to solve 4 equations with 4 unknowns using matlab
I suggest you try to solve it numerically using 'fsolve' rather than symbolically.

12 years ago | 1

| accepted

Answered
system of linear equations
It looks like a problem for the 'svd' (singular value decomposition) function where you select the vector that corresponds to th...

12 years ago | 0

Answered
zero mean and one variance
That's easy. Subtract the dataset's mean value from each element. Then divide each element by the dataset's standard deviation...

12 years ago | 0

| accepted

Answered
How to get a summation of elements of a matrix in a loop?
The most serious flaw in your code is the expression (sum(A(:,i+1)))-(sum(B(:,i)))-(sum(X(:,i))) These sums would be done...

12 years ago | 0

| accepted

Answered
can't get the real result for addition and division using basic arithmetic operations. pls help..
As John indicates, your trouble is trying to do matlab arithmetic with strings. When you apply an operation like + or / to char...

12 years ago | 0

Answered
what is the lowercase L in this expression?
There is nothing special about that lowercase 'l' except that in many fonts it is difficult to distinguish from the numeral '1'....

12 years ago | 0

Answered
self avoiding random walk
As I see it from all you have stated, Nawal, you wish to "walk" point-to-point starting at (0,0) for a maximum of 25 steps, at e...

12 years ago | 1

| accepted

Answered
Add a value in Matrix A from specific location in matrix B
If x is a given scalar value, you can find the index or indices (if any) in A that reference it with: p = find(A == x); T...

12 years ago | 0

Answered
How to create a 3D plot from 2D set of data .
Assuming that when you say "3D" you mean that x1 and x2 are along axes in different dimensions, then do: plot3(x1,x2,y) I...

12 years ago | 0

Answered
How can I loop through an equation with X different values of length at an angle Y, store coordinates then repeat for different angles
As your code is written, the 100 values of y and z are entered into the Y3 and Z3 arrays at the same places for each of the five...

12 years ago | 0

| accepted

Answered
question in the Statistics
1/4

12 years ago | 0

Answered
please i want to know where is the mistake in the this code
In the first line you compute R and tof. In the third and fourth lines you overwrite R. In the fifth and sixth lines you overw...

12 years ago | 0

Answered
find member of element
f = find(ismember(b,right));

12 years ago | 0

Answered
Finding maximums in matrix columns
Here's another way. Let A be your two-columned array. (Corrected) f = find([true;diff(A(:,2))~=0;true]); n = length(f)-2;...

12 years ago | 0

Answered
why is there an error about index out?
While you are increasing i in the while-loop there is the possibility of reaching an i such that i+1 is beyond the end of array ...

12 years ago | 0

Answered
How to modify the following code
To use more than one row in s, in place of N = length(s) you can do this: [M,N] = size(s); Then use your code (hopefully ...

12 years ago | 0

| accepted

Answered
How to write a function which determines the minimum and maximum values of a two input function over two intervals?
Presumably you are expected to use 'meshgrid' to create a mesh of all possible combinations of your two inputs over their respec...

12 years ago | 0

Answered
std does not give good values?
The 1.2910 value is the unbiased standard deviation which is default while the 1.1118 value is the second moment. Read the docu...

12 years ago | 1

| accepted

Answered
Replacing a for loop?
EImat=sum(reshape(A,seg_length,[]).^2,1)/seg_length; (Note: I assume here that the length of A is some integral multiple of...

12 years ago | 0

Load more