[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
behaviour different when loaded as toolbox
From: |
withaar |
Subject: |
behaviour different when loaded as toolbox |
Date: |
Thu, 15 Jan 2015 15:20:58 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
Hi all,
I am working on the quaternion toolbox and an running into odd
behaviour. I like making my own folder somewhere and work on functions,
possibly shadowing the original. In my case I originally did not have
the quaternion toolbox installed - at the moment I do but the result is
the same.
Question: does pkg does something special when loading/installing a toolbox?
This first section below shows the behaviour when using the installed
toolbox:
#------------------------------------------------
rmpath ("/home/willem/octave/toolbox/octave_toolboxes/quaternion")
rehash
which quaternion
#'quaternion' is a function from the file
/home/willem/octave/quaternion-2.2.2/@quaternion/quaternion.m
q = quaternion(randn(2,3,4),randn(2,3,4),randn(2,3,4),randn(2,3,4));
q.w(1,1,1)
q.w(1,1,1) = 0
#------------------------------------------------
This is no problem and runs as expected. Now to the version that is in a
different folder and not in a toolbox:
#------------------------------------------------
clear all
addpath ("/home/willem/octave/toolbox/octave_toolboxes/quaternion")
rmpath("/home/willem/octave/quaternion-2.2.2")
rehash
which quaternion
#'quaternion' is a function from the file
/home/willem/octave/toolbox/octave_toolboxes/quaternion/@quaternion/quaternion.m
q = quaternion(randn(2,3,4),randn(2,3,4),randn(2,3,4),randn(2,3,4));
q.w(1,1,1)
q.w(1,1,1) = 0
error: a cs-list cannot be further indexed
error: invalid assignment to cs-list outside multiple assignment
#------------------------------------------------
Where does the difference in behaviour come from? For the alternate
version subsref/subsassgn never get called.
Thanks!
Willem
- behaviour different when loaded as toolbox,
withaar <=