Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: if-statement with several commands in true case
Date: Mon, 6 Aug 2007 10:43:00 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 36
Message-ID: <f96tvk$auc$1@fred.mathworks.com>
References: <f96rk7$flf$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: webapp-00-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1186396980 11212 172.30.248.35 (6 Aug 2007 10:43:00 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 6 Aug 2007 10:43:00 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:422563


"Corinna Schmitt" <csc@mathworks.com> wrote in message 
<f96rk7$flf$1@fred.mathworks.com>...
> Hallo,
> 
> I want to work with the if-case. If a variable has a 
> special value than a block of commands should be done. My 
> idea was:
> 
> answer = input('Has your file this order? [Y/N] - ','s');
> 
> if answer=='Y' (

(snipped)

> )
> elseif 
>     display('Reorder you file and start the program again!')
> end
> 
> I always receive the following error message:
> ??? Error: File: aidaimportV5.m Line: 80 Column: 17
> Expression or statement is incorrect--possibly unbalanced 
> (, {, or [.
> 
> Can anyone help me?

I don't remember anywhere in the Matlab
documentation where it says to use ( ) to
wrap an if case.

In fact, I wonder if it is even legal matlab
syntax. It might be legal syntax in some
other language, but Matlab is not some
other language.

John