From bug-request at octave dot org Mon Dec 20 11:47:18 2004 Subject: Problem with end of vector From: Joe Koski To: Date: Mon, 20 Dec 2004 11:21:38 -0600 John, Here is a short script that demonstrates the problem with end that I mentioned in my e-mail message: curindminps = [1:20]; curindmaxps = [1:30]; LARGTRANSPS = 5; k = 3; i = 4; endcurmin=length(curindminps); endcurmax=length(curindmaxps); % the next line works stopps(k,i) = min(curindminps(max([1,endcurmin - LARGTRANSPS+1])),curindmaxps(max([1,endcurmax - LARGTRANSPS+1]))) % the next line doesn't work stopps(k,i) = min(curindminps(max([1,end - LARGTRANSPS+1])),curindmaxps(max([1,end - LARGTRANSPS+1]))); You may need to remove line breaks in the long lines to get this script to work. Problem #2: The same routine works with a test case provided by the originators and with one of my data sets, but fails with another data set: octave:1> run_drop_emd_online Enter name of input file: A-3_572-ALG-BIAS.txt size_x = 1 12500 size_t = 1 12500 vel_impact = 16.447 error: invalid XXX FIXME XXX index = 12600 error: evaluating argument list element number 1 error: evaluating if command near line 284, column 11 error: evaluating if command near line 282, column 4 error: evaluating if command near line 277, column 2 error: evaluating for command near line 274, column 7 error: evaluating while command near line 273, column 5 error: evaluating for command near line 262, column 3 error: evaluating while command near line 260, column 1 error: called from `emd_online' in file `/Users/jakoski/Codes/EMD MatLab Routines/emd_online.m' error: called from `run_drop_emd_online' in file `/Users/jakoski/Codes/EMD MatLab Routines/run_drop_emd_online.m' Since emd_online is not my script and I have no idea what indices are in use, I would probably need to send the entire script to reproduce the problem in octave. Any ideas? Octave problem or problem with the script? Joe ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------