f



Does 4/2/2= (4/2)/2 =1 OR = 4/(2/2)=4

I don't have matlab and I am trying to translate some simple matlab code.

Does 4/2/2  = (4/2)/2 = 1
or   4/2/2  = 4/(2/2) = 4 
0
9/11/2012 2:43:25 PM
comp.soft-sys.matlab 211264 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

3 Replies
3382 Views

Similar Articles

[PageSpeed] 40

On 9/11/2012 9:43 AM, sarah.englander@gmail.com wrote:
> I don't have matlab and I am trying to translate some simple matlab code.
>
> Does 4/2/2  = (4/2)/2 = 1

yes.  At a given precedence level (and obviously two of the same 
operators are the same level) evaluation proceeds from LtoR.

....snip...

<http://www.mathworks.com/help/techdoc/matlab_prog/f0-40063.html#f0-38155>

--

0
none1568 (7453)
9/11/2012 2:57:51 PM
dpb <none@non.net> wrote in message <k2njh1$jes$1@speranza.aioe.org>...
> On 9/11/2012 9:43 AM, sarah.englander@gmail.com wrote:
> > I don't have matlab and I am trying to translate some simple matlab code.
> >
> > Does 4/2/2  = (4/2)/2 = 1
> 
> yes.  At a given precedence level (and obviously two of the same 
> operators are the same level) evaluation proceeds from LtoR.
> 
> ...snip...
> 
> <http://www.mathworks.com/help/techdoc/matlab_prog/f0-40063.html#f0-38155>
> 
> --
There are a few thing you need to understand:
1. You need to get matlab in order to translate the simple code
2. You should define your parameters as in what is the expected output of your search based on the equations used:
    Is it : a) 4/2/2 
            b) (4/2/2)
0
salvinder (8)
9/12/2012 4:13:08 AM
On 9/11/2012 11:13 PM, Salvinder wrote:
..

> There are a few thing you need to understand:
> 1. You need to get matlab in order to translate the simple code
> 2. You should define your parameters as in what is the expected output
> of your search based on the equations used:
> Is it : a) 4/2/2 b) (4/2/2)


??????

a) One can read Matlab code from the syntax and rules of the language 
(else't neither could TMW write the interpreter/jit compiler).

b) >> (4/2/2)==4/2/2
ans =
      1
 >>

I think we understand these few things...

--

0
none1568 (7453)
9/12/2012 12:35:13 PM
Reply: