From: ravi on
Hi guys,

I have the following code:

for iteration = 1:5
iteration;

A = 2;
B =4;
C =3;

d_computed = (A + B +C)


misclosure = [ d_computed]

end

However, I want my iteration to run such that

my misclosure is as follows

misclosure = [ previous_d_computed - current_d-computed]

Can any help me out


best,
ravi
From: Mitch on
On Apr 10, 10:03 pm, "ravi " <ravi_...(a)hotmail.com> wrote:
> Hi guys,
>
> I have the following code:
>
> for iteration = 1:5
>         iteration;
>
> A = 2;
> B =4;
> C =3;
>
>  d_computed = (A + B +C)
>
>  misclosure = [ d_computed]
>
> end
>
> However, I want my iteration to run such that
>
> my misclosure is as follows
>
>       misclosure = [ previous_d_computed -  current_d-computed]
>
> Can any help me out
>
> best,
> ravi

previous_d_computed = 0;

for iteration = 1:5
iteration;
A = 2;
B =4;
C =3;
d_computed = (A + B +C)
misclosure = abs(previous_d_computed - d-computed)
previous_d_computed = d-computed;
end


?????




can't you save your
From: nanren888 on
"ravi " <ravi_071(a)hotmail.com> wrote in message <hprl4b$67n$1(a)fred.mathworks.com>...
> Hi guys,
>
> I have the following code:
>
> for iteration = 1:5
> iteration;
>
> A = 2;
> B =4;
> C =3;
>
> d_computed = (A + B +C)
>
>
> misclosure = [ d_computed]
>
> end
>
> However, I want my iteration to run such that
>
> my misclosure is as follows
>
> misclosure = [ previous_d_computed - current_d-computed]
>
> Can any help me out
>
>
> best,
> ravi

Ravi, Hi
I have no idea what you want to achieve.
A,B,C are defined inside the loop & don't change.
Can you explain again?