View Single Post
  #14  
Old July 29th, 2008, 03:25 PM
CaptainBlack's Avatar
CaptainBlack CaptainBlack is offline
Grand Panjandrum
 
Join Date: Nov 2005
Location: South of England
Posts: 11,379
Country:
Thanks: 667
Thanked 3,619 Times in 2,916 Posts
CaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond repute
Default

Quote:
Originally Posted by hunter View Post
I hav put the code in my program, portion i added is below, but i the following error:


??? Error: File: Loop_NoP_V2_Theta_Plane1_Plane2.m Line: 19 Column: 3
Illegal use of reserved keyword "else".

Code I put in:

L=128

for idx =1 : 10
if idx==1
%load the spreadsheet
flin='C:\Documents and Settings\prhill\My Documents\Hill\Point_Clouds\20_1_00.asc';
flout=[f100,num2str(101);
else
flin=flout
flout=[f100,num2str(100+idx)];
end

points=load(flin);


Any new helpful hints?

Thanks

Matlab can be flakey about some uses of the contol variable inside the loop.

Try:

L=128

for idx =1 : 10
tst=idx;
if tst==1
%load the spreadsheet
flin='C:\Documents and Settings\prhill\My Documents\Hill\Point_Clouds\20_1_00.asc';
flout=[f100,num2str(101);
else
flin=flout
flout=[f100,num2str(100+idx)];
end

points=load(flin);

RonL
__________________
Truth does not change because it is, or is not, believed by a majority of the people.

Giordano Bruno
Reply With Quote
The following users thank CaptainBlack for this useful post:
Donate to MHF