Answered
coding the way of selection between two matrices
The difficulty with your question, Fatema, is that you have not made it clear what you want to happen with respect to matrices A...

11 years ago | 0

| accepted

Answered
How many years do i need to get the amount?
This is a problem in compound interest, the compounding occurring once each year. Think it through like this. After one year y...

11 years ago | 0

Answered
Help understand the sumsqr algorithm
If you consult the site http://www.mathworks.com/help/nnet/ref/sumsqr.html you will see that 'sumsqr' returns with the ...

11 years ago | 2

Answered
How to reverse a number
@Jessica: Let x be a non-negative integer. Then y will have the decimal digits of x in reversed order. y = 0; while ...

11 years ago | 3

Answered
How to define a cone with an irregular basis
Using your X and Y for points along the curve and (x0,y0,z0) for the "cone" vertex coordinates (with z0>0,) let (x,y,z) be coord...

11 years ago | 0

Answered
summing up a large single precision array
When the cumulative sum of your array has reached, say, the halfway point around 2.5e9, in each further addition the size of the...

11 years ago | 4

| accepted

Answered
Triple integral found sym ?
Matlab's error message has told you what one difficulty is. Your input function is returning 'sym' values because you declared ...

11 years ago | 0

Answered
How to solve 7 unknowns with 7 equations with ln
Try using 'log' instead of 'ln' for the natural logarithm. I don't think 'solve' recognizes 'ln'.

11 years ago | 0

Answered
How to obtain discernable permutations of a vector ?
In your particular example, (1,1,1,0,0), the number of possible distinct permutations is 5!/3!/2! = 10 (corrected), and these ca...

11 years ago | 3

| accepted

Answered
How to convert the following program to vector operation (not using for loop)
elseif y = sum(-(-x).^(1:n)./(1:n); ... You should be aware that this series sum will approach log(1+x), not log...

11 years ago | 0

Answered
taylor series expansion of cosx
Hint to Jiang: Note that in the successive terms of the series for cos(x), there is a rather simple arithmetic operation that c...

11 years ago | 0

Answered
Can someone explain to me how this function works?
The complete 'nextTemps' function is not shown, so we are left guessing about some parts of it. For example we can only guess t...

11 years ago | 1

| accepted

Answered
rectify the error in the code below
If 'w' has more than one column, you will get an error because w * ((a(1,:) - b(i,:)).^2) is performed before the divi...

11 years ago | 2

Answered
Tangent to two circles
Here is a direct matlab solution to your problem, Ramin, that does not involve iterative solution of equations. It just uses si...

11 years ago | 5

| accepted

Answered
How can I find a tangent line to an unknown point on a curve?
Find a tangent line from a given point (x0,y0) to the curve y = (3-x).^2+5 is a matter of solving two simultaneous equa...

11 years ago | 2

Answered
Probability dealing a deck of cards. Need helps!
It is really up to you to try to work on the matlab approach to this problem yourself and to then show us what you have tried so...

11 years ago | 2

Answered
How to sum up of sum unique arrays in a matrix
Assuming like IDs are already grouped together as in your example, t = [true;diff(a(:,1))~=0;true]; b = [zeros(1,size(...

11 years ago | 1

Answered
How to generate a random array of 1*N matrix in which sum of all elements is 1 and numbers generate should be upto 1 decimlal place only.
diff([0,sort(randi([0,10],1,N-1)),10])/10; % <-- Corrected

11 years ago | 0

| accepted

Answered
How to write the Taylor Series approximation for arctan?
You are starting i at -1 which would make the first term x^(-3)/(-3) You had better start i at +1. Also since the i's ...

11 years ago | 2

Answered
How to reshape matrix in this way?
I think this does it for the first of your desired d's: d = reshape(permute(reshape(a,3,3,2,2),[1,3,2,4]),6,6); Added: ...

11 years ago | 0

Answered
What's wrong with my code? (Beginner's question; geometric sum)
Replace for i=2:n by for i=2:2:n Or you could always just write (1-r^(n+2))/1-r^2) for even n.

11 years ago | 1

| accepted

Answered
How to write a code for finding a definite integral for ( 1/x(t).^2 ) please?
You can check it by comparing its results with the exact mathematical solution to your differential equation. The solution to d...

11 years ago | 2

Answered
Results are Fractional and Imaginary
Be aware that taking cube root is actually equivalent to solving a cubic equation and thus always has three possible roots - tha...

11 years ago | 2

Answered
Modifying matrix with if statement
To correct the problem you describe, do that last for-loop backwards: for jj=nn:-1:1 if ....

11 years ago | 0

| accepted

Answered
How to fit with an infinite serie function ?
If you substitute s = exp(-D*pi^2*t/(4*L^2)) your function becomes the sum of the infinite series f(s) = 1 - 8/pi...

11 years ago | 3

| accepted

Answered
Why is there a value mismatch in my data sets?
It is entirely possible that two matlab 'double' numbers can have the same display using "format longeng" and yet be different. ...

11 years ago | 2

Answered
When I calculate exp(3.8566e5*1i) and exp(data*1i) answers are different why? Here, data=3.8566e5
When you display 'Data' with Data = 3.8566e+005 the difference between the actual value of 'Data' and the display...

11 years ago | 2

| accepted

Answered
Trapezoidal question set, big problems (new user)
Assuming you are not allowed to use 'trapz', the algorithm for trapezoidal integration is very simple to implement in matlab. S...

11 years ago | 1

Answered
How to use the solve function with a changing parameter?
There is an important difference between solving your equations symbolically in terms of t, as compared with solving them with t...

11 years ago | 2

Answered
How to solve these easy equations below? (quadratic equation)
Eliminate C and get the polynomial equation 20*L^7 + 60*L^6 + 7 = 0 (<-- Corrected) and use 'roots'.

11 years ago | 0

Load more