
Anyway, codes like CHOLMOD are dual licensed GPL/commercial. For example, that's been most of Tim Davis' career. Writing high-performing, multicore factorization codes is hard and only a few people do that well. Vastly cheaper access to high quality linear system solvers. There's an auxiliary reason to use Octave/MATLAB that most people don't talk about. This is a legacy from C's use of the comma operator inside macros. The comma operator (the "evaluate but ignore first operand, return second operand" operator) has higher precedence inside "a" than inside "a()". Amusingly, you can't overload "operator" in C++ with more than one argument. The C idiom "a" has become pervasive, replacing actual multidimensional array subscripts such as "a" (Pascal, Modula) or "a(i,j)" (Octave, MATLAB and FORTRAN). You can't just do one allocate, then copy the entire array. This gets expensive if you have some language where arrays are first-class result types. Languages which do subscript checking have to deal with this, and usually can't hoist subscript checks out of inner loops.Īllocating an array of arrays can require a lot of allocations, as does copying such an array. Arrays of arrays can be ragged - not all the rows need be the same length. There are performance, and in some languages, safety issues with arrays of arrays. Perhaps the Matlab IDE is an advantage, but that doesn't come with Octave, and Jupyter or Atom+Julia are relatively user-friendly. I think the advantage of Matlab is the toolboxes in engineering contexts, but that Julia has a similar learning curve for beginners working with matrices. Even things like the built-in support for intermixing Greek letters were surprisingly helpful. But then there is a lot of of syntactic sugar too after you get past the early stages. Julia however comes with the easy Matlab/Octave syntax for handling matrices. Python too can be verbose for doing the simple/toy problems that are helpful when learning. The xapply() functions can also be more confusing than picturing how you iterate through loops. I like R, but understand that %*% for matrix multiplication, solve() instead of \, and the relatively cumbersome syntax for defining matrices indicate that it not designed primarily for users to interact with matrices at a lower, mechanical level. I wonder if he would likely choose Julia now. Julia wasn't around, or it was very early, when he designed the Machine Learning course or was teaching Stanford students, and he's moved on since then. I took the EdX/MIT course on optimization methods and constraint solvers using Julia and JuMP and it was really fun. Most of the features of python that I presented as cons are actually pros when the codebase is more than 1000 lines and needs structure and safety. Also it's nicer to write M * v than np.dot(M,v). After 5 minutes you think you're all set to calculate the M * v, but then your vector happens to be a line vector and not a column vector and you need to learn the difference. In python, you first figure which modules to import, the difference between python arrays and numpy arrays, and god forbid you happen to find the numpy matrix type instead of numpy array type.
Write subscript gnu octave code#
In octave you are done in 3 lines of code in 30 seconds. Say, you have some numbers for a matrix and a vector in files and want to read them in and multiple the vector by the matrix. So I guess for newcomers and for quick prototyping (just 10s or 100s lines of code), octave is nicer. I have installed the io and statistics packages.In the Stanford/Coursera machine learning class, Andrew Ng said that his teaching experience is that students pick up octave/matlab quicker and the course can cover more actual machine learning, compared to python where more time is spent learning the language. I started running Octave a few weeks ago, so it wouldn't be impossible that my installation failed somehow. I also fail to reproduce other code with the text function.
Write subscript gnu octave how to#
I'm a bit stumped as to how to solve this. Text(4.): but text has size 1x39 (note: variable 'text' shadows function) Text (4, 4, 'Hello','horizontalalignment', 'center','verticalalignment', 'middle') Text(, , ,): subscripts must be either integers 1 to (2^63)-1 or logicals (note: variable 'text' shadows function) I try to reproduce the code on this page:įor example, I try to reproduce Demonstration 3 there, i.e.
