How to change the previous result ?
Show older comments
Hi, I want to compute the solution :
for n=2,... where
. With the initial solution
.
For example :
if n=2,
then 
if n=3,
, it's possible to rewrite S as :
where S is the previous result has stored but have to replace
with
, then compute 
if n=4,
, it's mean
where S is the previous result has to replace
with
and
with
.
and continue .....
Here what i did :
S = 0;
U1 = 5;
k = 0;
for n=2:10
% Compute the sum term
k = k+1;
b = sqrt(n-k+1)-sqrt(n-k);
S = S+b*U1;
% Compute the new solution
U = S+10;
% Overwrite the solution to change the result of the sum S : S = b*U;
% without use the index U(i)
U1 = U;
% but it's not correct
end
What I do ?
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!