From bug-octave-request at bevo dot che dot wisc dot edu Thu Sep 11 13:08:53 1997 Subject: Re: cannot enter a large matric - line size limitations? From: "John W. Eaton" To: sshteingold at cctrading dot com cc: bug-octave at bevo dot che dot wisc dot edu Date: Thu, 11 Sep 1997 13:08:35 -0500 On 11-Sep-1997, sshteingold at cctrading dot com wrote: | mx.m: | --------------------- | | a=[[1176.6727, 237.76727, 13.9138365, 1.1117959, 292.83942, 891.596, | 1001.67004, 1257.4712, 2610.2913, 48.436954]; | [237.76727, 49.238163, 2.7816741, 0.23123477, 59.467945, 180.76357, | | ... | | octave.exe:4> load mx.m | error: load: mx.m: inconsistent number of columns near line 16 | error: load: unable to extract matrix size from file `mx.m' | error: evaluating index expression near line 4, column 1 | octave.exe:4> ls I think there's some misunderstanding about what `load file' is supposed to do. If you have an M-file containing Octave statements, you can execute it just by typing the name of the file (without the .m). For example, if your mx.m file contains a = [1, 2, 3]; then you would just type octave:1> mx to execute the commands in mx.m (see the section in the manual about script files for more details). The load command is for loading files that contain data (in various formats, but not language statements). Also, you don't need to put square brackets around each row of your matrix: a = [1, 2, 3; 4, 5, 6; 7, 8, 9]; should work fine. If you do want to load data only from a file, it should work to put numbers only in the file: 1 2 3 4 5 6 7 8 9 and so on. Spaces separate numbers on a row and new lines separate rows. Then you can use the load command to load the file. The name of the file will be used as the name of the loaded matrix, so you must use a name that is valid as an identifier (though you can use .dat as an extension and that will be dropped from the name). For example, bevo:29> cat > foo.dat 1 2 3 4 5 6 7 8 9 bevo:30> octave load foo.dat foo Octave, version 2.0.9 (alpha-dec-osf3.2). Copyright (C) 1996, 1997 John W. Eaton. This is free software with ABSOLUTELY NO WARRANTY. For details, type `warranty'. octave:1> load foo.dat octave:2> foo foo = 1 2 3 4 5 6 7 8 9 | The long lines make readline do wonders.... ;-) Sorry, I'm not sure I understand what you mean. | BTW, neither ls nor dir work under NT. Hmm. I don't know what would cause that problem. But there is some hope that it will be solved because I now have a second system to use for doing some NT work. jwe