help-octave
[Top][All Lists]
Advanced

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

Re: Variables in Switch Case


From: Ben Abbott
Subject: Re: Variables in Switch Case
Date: Mon, 02 Apr 2012 13:27:05 -0400

On Apr 2, 2012, at 12:04 PM, Mech.Mon wrote:

> Hello,
> 
> In C++ I can do ;
> 
> switch (value)
> {   
> case Value1:  
> {
>  int Value1 = 10525;  
>  break;
> }
> case Value2:  
>  int Value1 = 55874;  
> break;
> }
> 
> Is there a way to assign variables, inside a switch statement, in Octave?
> 

yes.

http://www.gnu.org/software/octave/doc/interpreter/The-_003ccode_003eswitch_003c_002fcode_003e-Statement.html#The-_003ccode_003eswitch_003c_002fcode_003e-Statement

Ben



reply via email to

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