From bug-octave-request at bevo dot che dot wisc dot edu Thu Sep 11 13:26:01 1997 Subject: Re[2]: cannot enter a large matric - line size limitations? From: sshteingold at cctrading dot com To: Cc: Date: Thu, 11 Sep 97 14:25:04 -0500 OK, using your advice (THANKS!) I managed to create 2 files, an m file and a dat file, and I can load the matrix and the vector from *both* of them. BUT: when I type `BB' I get something like octave.exe:4> BB BB = Columns 1 through 6: 1.4453e+05 2.9640e+04 1.7118e+03 1.3914e+02 3.6131e+04 1.0988e+05 Columns 7 through 10: 1.2348e+05 1.5785e+05 3.2546e+05 5.9659e+03 while when I type something like: octave.exe:11> BB/xx ans = Columns 1 through 5: -9.7011e+00 2.4387e+01 1.9982e+03 -9.8308e+04 1.2876e+03 Columns 6 through 10: -2.0254e+02 9.9029e+01 1.7231e+02 2.2700e+00 -5.9174e+03 octave.exe:12> BB/AA ans = Columns 1 through 5: -9.7011e+00 2.4387e+01 1.9982e+03 -9.8308e+04 1.2876e+03 Columns 6 through 10: -2.0254e+02 9.9029e+01 1.7231e+02 2.2700e+00 -5.9174e+03 octave.exe:13> AA octave.exe:14> BB BB = Columns 1 through 6: 1.4453e+05 2.9640e+04 1.7118e+03 1.3914e+02 3.6131e+04 1.0988e+05 Columns 7 through 10: 1.2348e+05 1.5785e+05 3.2546e+05 5.9659e+03 octave.exe:15> xx octave.exe:16> octave.exe:16> As you can see, it has (apparently correct) values in xx and AA, but it refuses to print them, which is very frustrating! ______________________________ Reply Separator _________________________________ Subject: Re: cannot enter a large matric - line size limitations? Author: "John W. Eaton" at INET Date: 1997-09-11 13:08 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