help-octave
[Top][All Lists]
Advanced

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

Re: Understanding a dot


From: Johan Kullstam
Subject: Re: Understanding a dot
Date: Mon, 24 Mar 2008 09:17:51 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Søren Hauberg <address@hidden> writes:

> man, 24 03 2008 kl. 10:47 +0100, skrev Kim Hansen:
>> I guess 1. is read by the same code that would read 1.0, the code
>> could be reformated as:
>>   for i = 1.
>>       length(tmp)
>>       i
>>   endfor
> Yeah, okay, that kinda makes a little bit of sense (not much though).
> What really bugs me is that
>   i = 1.length(tmp)
> gives an error (like expected), but
>   for i = 1.length(tmp) ...
> doesn't. This is perfectly compatible with Matlab, but it is a really
> weird thing to do IMHO.
>
>> How does Matlab handle decimal points without any decimals after them?
>>> 1.
>
> ans =
>
>      1
>
> Octave does the same thing.
>
> Søren

I hate the dangling dots.

jk:12> a = [20;3]
a =

  20
   3

jk:13> 1/a
ans =

  0.0488998  0.0073350

jk:14> 1./a
ans =

  0.050000
  0.333333

jk:15> 1. / a
ans =

  0.0488998  0.0073350

So now the space changes things.

The dot will adhere to the "/" rather than the "1".  The problem is
you have to try it to see which way it goes.

Also annoying is matlab using ' for both complex-conjugate-transpose
and string quote.  In octave we can use " for strings but then it's
not compatible.

-- 
Johan KULLSTAM



reply via email to

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