[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"which" doesn't quite work ?
From: |
Sergei Steshenko |
Subject: |
"which" doesn't quite work ? |
Date: |
Sun, 9 Sep 2012 15:04:14 -0700 (PDT) |
Hello,
the Email is inspired by a recent thread. Here is the screen session:
"
octave:1> Sample = {-0.123, 0.234}
Sample =
{
[1,1] = -0.12300
[1,2] = 0.23400
}
octave:2> foo=Sample(1,2)
foo =
{
[1,1] = 0.23400
}
octave:3> help type
`type' is a function from the file
/home/qemu/AFSWD/20120424/octave-3.6.2/share/octave/3.6.2/m/help/type.m
-- Command: type NAME ...
-- Command: type -q NAME ...
-- Function File: dfns = type ("NAME", ...)
Display the definition of each NAME that refers to a function.
Normally also displays whether each NAME is user-defined or
built-in; the `-q' option suppresses this behavior.
If an output argument is requested nothing is displayed. Instead,
a cell array of strings is returned, where each element
corresponds to the definition of each requested function.
Additional help for built-in functions and operators is
available in the on-line version of the manual. Use the command
`doc <topic>' to search the manual index.
Help and information about Octave is also available on the WWW
at http://www.octave.org and via the address@hidden
mailing list.
octave:4> help which
`which' is a function from the file
/home/qemu/AFSWD/20120424/octave-3.6.2/share/octave/3.6.2/m/help/which.m
-- Command: which name ...
Display the type of each NAME. If NAME is defined from a function
file, the full name of the file is also displayed.
See also: help, lookfor
Additional help for built-in functions and operators is
available in the on-line version of the manual. Use the command
`doc <topic>' to search the manual index.
Help and information about Octave is also available on the WWW
at http://www.octave.org and via the address@hidden
mailing list.
octave:5> type foo
foo is a variable
{
[1,1] = 0.23400
}
octave:6> type Sample
Sample is a variable
{
[1,1] = -0.12300
[1,2] = 0.23400
}
octave:7> which foo, Sample
Sample =
{
[1,1] = -0.12300
[1,2] = 0.23400
}
octave:8> which Sample, foo
foo =
{
[1,1] = 0.23400
}
octave:9>
".
Please note that "help which" says "Display the type of each NAME", but both
"which foo, Sample", "which Sample, foo" display the type of just _one_ last
item, and not of each name.
Furthermore, in the same session:
"
octave:9> which "foo"
octave:10> which foo
octave:11> which Sample
octave:12> which "Sample"
",
i.e. if I specify just one name, nothing is displayed.
This is octave-3.6.2.
Is it supposed to be this way ?
Thanks,
Sergei.
- "which" doesn't quite work ?,
Sergei Steshenko <=