help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple 'for' loop question


From: Rob Teasdale
Subject: Re: Simple 'for' loop question
Date: Wed, 6 Jun 2007 01:25:46 -0700 (PDT)

Thanks all,

Yep, I couldn't see the forest for the trees - it was a long day. All fine now 
that I have my variable names sorted out :) Thanks Jordi for your response, I 
am new to Octave, so I am still working out the best way of vectorising code as 
many posts indicate that this will speed up calculation time significantly ( I 
still fall back to traditional programming methods!)

Cheers
Rob

----- Original Message ----
From: Thomas Weber <address@hidden>
To: address@hidden
Cc: Rob Teasdale <address@hidden>
Sent: Tuesday, 5 June, 2007 11:59:38 PM
Subject: Re: Simple 'for' loop question

Am Dienstag, 5. Juni 2007 23:57 schrieb Rob Teasdale:
> function [CO] = p_area(X,Y,Z,O)
>     [R C] = size(X)
>     row = 1;
>     for i = 1:R
>         for j = 1:C
>             C = [X(i,j) Y(i,j) Z(i,j)];

You are overwriting your "C" here. Is that intended?

> Output
> octave:3> rob_test

If the above doesn't help, please provide your test script.

    Thomas





      
_________________________________________________________________________________
              

How would you spend $50,000 to create a more sustainable environment in 
Australia? Go to Yahoo!7 Answers and share your idea.
http://advision.webevents.yahoo.com/aunz/lifestyle/answers/y7ans-babp_reg.html





reply via email to

[Prev in Thread] Current Thread [Next in Thread]