Q1.2: How do I get the imaginary unit? Variable i has no value.
Q1.3: How to build a matrix of all clone rows?
Q1.4: How to place a doublequote in a string?
Q1.5: Why do I see the stupid error message 'Undefined function <Undefined>'?
Q1.6: I use eval to assign to a variable, but afterwards the variable seems to be undefined.
Q1.7: I use import to read some file but the variables aren't there!
Q1.8: How to take a columnwise mean, max, sum or min of a matrix?
Q1.9: Why does map function complain that the first argument is not a function?
Q1.10: How to form the outer product of two vectors?
Q2.2: Which file formats can Tela read/write?
Q2.3: How to run Tela in batch mode?
Q2.4: How to check about the latest version of Tela?
Q3.2: I get a core dump. Should I report it?
Q3.3: It gives me wrong results, what should I look at first?
Q3.4: The stddev function gives slightly different result as std in Matlab?
Because "]>" is special operator in Tela, the right bracket for mapped
indexing. See "help mapped". Insert space between ] and >. The m2t
translator should be fixing this automatically now.
Use the notation 1i for the imaginary unit, 0.5+2i etc. for general
complex numbers, 0i for complex zero. The "i" here is syntactically
part of the number, not a variable name. In this way the variable "i"
may be used for other purposes, such as loop indexing.
Assume you have a vector V = #(1,2,3), and you want to build matrix M:
M = #(1, 2, 3;
1, 2, 3;
1, 2, 3;
1, 2, 3;
1, 2, 3);
First create matrix A as A = #(V). Then M = A[ones(5),:].
Use backslash before the doublequote. The method of quoting things
is identical with C.
You are calling an undefined function. Ideally Tela should be able
to report its name, but currently it isn't. However, usually there are
not many possible undefined function calls on one source line.
The builtin function eval works in global context. All symbols appearing
in the evaluated string refer to globally visible names. If you are calling
eval from within a function, you must declare those variables global in
the function header which you want to access in the evaluation string.
The same is true with load, save, import and export_matlab (see below).
See above. You are probably calling import within a function, and the
imported variables go to the global context. You must declare the variables
global in the function you are calling import from.
Version>=1.2: Use mean(x,d), sum(x,d) etc. to apply the operation
along dth dimension.
Version<1.2:
Use the map functional. Say map(mean,A,1) or map(mean,A,2) to take
mean along first or second dimension, respectively. Two points must
be noted: 1) The functional argument (mean) must be declared global in the
enclosing function or package, if any, 2) you cannot use intrinsic
functions. Examples of intrinsic functions: min, max, abs. Workaround
is to declare auxiliary functions: function y=min1(x) {y=min(x)}.
Limitation (2) will probably go away in some future version of Tela.
If you didn't misspell the function name, the reason is probably that
you didn't declare it global in the enclosing function or package scope.
Tela understands that f is a function if it is called in the usual way,
e.g. f(x), but now f is an argument, map(f,A,d), and Tela interprets f
as a local variable unless explicitly declared global by some means.
If V and U are vectors of length N, their outer product V times U
can be formed as reshape(V,N,1)**reshape(U,1,N).
There are three kinds of tools available for Matlab interfacing.
First, you can load Matlab ASCII and binary files (MAT-files) using
the import and import1 commands. The function export_matlab performs
the reverse operation, i.e. it saves your Tela variables in Matlab-
readable binary file. With these functions it is possible and easy
to e.g. transfer all workspace variables from Matlab to Tela and back
again. Of course, more than two-dimensional arrays have trouble
translating to Matlab :-)
Second, you can translate your existing Matlab programs to Tela
using m2t. The success of this depends on what kind of Matlab code
you have. Sometimes a 100-line script translates and runs in Tela
with no problems at all, but usually you must do some hand editing.
Anyway, using m2t should always be much faster than purely manual
translation.
Third, if you have the matlabeng module installed within Tela,
you can call Matlab functions and do Matlab evaluations directly
from Tela. For example, if Tela is missing some special function
or some linear algebra subroutine, e.g. QR decomposition, you
would typically send mail to tela-suggestions@fmi.fi about it,
but in the meantime you can get along by calling the missing function
from Matlab.
Reading: HDF (SDS), various ASCII, Matlab binary.
Writing: HDF (SDS), Matlab binary, any ASCII by using fprintf or fformat.
Currently Tela cannot process raster image HDF files.
Say:
batch <tela.run
where file tela.run contains something like:
input_file = mytelarun.t
output_file = telarun.out
tela -b $input_file >$output_file
Look at http://sumppu.fmi.fi/prog/tela.html and point at "Change log".
This really should be fixed, but sometimes when Tela gets too confused
by your input it core dumps. Check that your parentheses match, check also
that you use "string" and not 'strings'.
If you get it during execution of a program, you definitely should report
it. If you get it in parsing phase, you also may report it if it occurs
frequently and repeatably and you just can't stand it any more.
Check possible overflows of integer variables. Tela does not check for
any overflows, it behaves like C or Fortran in this respect. For
example, if you assign T=2000 and then compute T^4 (as in Stefan-
Boltzmann law) you get a wrong result on most platforms. Use explicit
decimal point, T=2000.0 . Use whos() to see the types of your variables.
In Tela, stddev divides by N whereas in Matlab std divides by N-1.
Should be insignificant for normal uses.
tela-bugs@fmi.fi