[Top][All Lists]

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

Re: Octave 3.2.4 - Error Calculating Powers of 2

From: Ben Abbott
Subject: Re: Octave 3.2.4 - Error Calculating Powers of 2
Date: Thu, 17 Mar 2011 10:30:58 -0400

On Mar 17, 2011, at 2:47 AM, Vickreman Chettiar wrote:

> Hi.
>   I have recently installed Octave, and I am trying to calculate the powers 
> of two from 1 to 50 with the following code.
> n=1:50; m=2^n; disp(m)
> I keep getting the following error
> error: for x^A, A must be square
> and have not so far been able to perform the calculation in Octave.
>   I see no reason why A has to be square, and I have checked the manual and 
> confirmed that ^ is indeed the symbol for exponentiation. Am I doing 
> something incorrectly, or is this a bug? How do I fix the problem?
> I am using version 3.2.4 of Octave. My operating-system is the 64-bit version 
> of Microsoft Windows 7 Professional Edition.
>   Thank you and regards, Vickreman.

Try replacing "^" with ".^"

        n=1:50; m=2.^n; disp(m)


reply via email to

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