Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
iteration issue

Subject: iteration issue

From: ravi

Date: 11 Apr, 2010 05:02:04

Message: 1 of 2

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

Subject: iteration issue

From: nanren888

Date: 11 Apr, 2010 06:33:12

Message: 2 of 2

"ravi " <ravi_071@hotmail.com> wrote in message <hprl4b$67n$1@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?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us