[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Why is different ^ and .^?
From: |
Javier Arantegui |
Subject: |
Why is different ^ and .^? |
Date: |
Mon, 23 May 2005 20:10:29 +0200 |
User-agent: |
KMail/1.8 |
Hello,
This is a question from a newbie, please don't be very hard with me ;-) I
don't think that this is a new question but I haven't find the answer.
I am introducing Octave as a tool to teach process control. My students find
very confusing, and frankly I agree with them, the need to add . to the
operators when you are using vectors. For example, using Octave 2.1.64:
octave:7> a=0:1:10;
octave:8> a.^2
ans =
0 1 4 9 16 25 36 49 64 81 100
octave:9> a^2
error: for A^b, A must be square
error: evaluating binary operator `^' near line 9, column 2
Why the second option (^ instead of .^) doesn't work? Shouldn't be easier if
you could use the same operator as when you are working with an scalar? I'd
be happy if you could provide me an explanation that I could give to my
students.
Thanks in advance,
Javier
--
Javier Arántegui
Dept. Tecnologia de Alimentos / Dept. of Food Technology
Universitat de Lleida / University of Lleida (Spain)
Tel. +34 973702595
Fax +34 973702596
IM: Jabber - javier.arantegui (AT) jabberes.org
http://www.tecal.udl.es
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- Why is different ^ and .^?,
Javier Arantegui <=