Tue 01 Dec 2015 02:40:15 PM UTC, comment #13:
indeed it works,
but when i want to use this function recursively or any other it will not be enough.
I made another mistake with the result name
function1=function1('/home/andrefougeront/clone/search-workers/image-processing/algo/set_of_images/compression_niv10-100/compresse10/01a10.jpg')
It may be the issue, I know it is quite a mess i m really sorry, I ll ask you next time with a clearer issue and well printed
I apologize, thank you
|
Tue 01 Dec 2015 02:28:55 PM UTC, comment #12:
do a clear
and then your function1 will work at least once.
where are you making the variable function1?
|
Tue 01 Dec 2015 02:20:15 PM UTC, comment #11:
I made a mystake on the whos command
>> whos
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
ans 1x1 8 double
function1 1x1 8 double
Total is 2 elements using 16 bytes
|
Tue 01 Dec 2015 02:18:41 PM UTC, comment #10:
here is the result and the whos command
> result1=function1('/home/andrefougeront/clone/search-workers/image-processing/algo/set_of_images/compression_niv10-100/compresse10/01a10.jpg')
res = 1
result1 = 1
>> result1=function1('/home/andrefougeront/clone/search-workers/image-processing/algo/set_of_images/compression_niv10-100/compresse10/01a10.jpg')
error: A(I): index out of bounds; value 119 out of bound 1
>> whos
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
ans 1x1 8 double
babu 1x1 8 double
Total is 2 elements using 16 bytes
And here is the function script
function res=function1(img)
res=1
endfunction
|
Tue 01 Dec 2015 01:53:40 PM UTC, comment #9:
Hello!
The change of the function script deleted the bug for a while but it came back today! I guess it was not the real issue and may still have an issue on string inputs randomly on any function
taking back my error example I could add other error message alike:
>> result1=function1('/home/andrefougeront/clone/search-workers/image-processing/algo/set_of_images/compression_niv10-100/compresse10/01a10.jpg')
error: A(I): index out of bounds; value 119 out of bound 1
>> result1=function1('xyzù')
error: A(I): index out of bounds; value 195 out of bound 1
>> result1=function1('xzù')
error: A(I): index out of bounds; value 195 out of bound 1
>> result1=function1('xyzùy')
error: A(I): index out of bounds; value 195 out of bound 1
>> result1=function1('aaaaaabcdnaxv')
error: A(I): index out of bounds; value 120 out of bound 1
Please let me know if you have any other idea, I'm pretty sure should not come from the function script.
|
Mon 30 Nov 2015 03:52:42 PM UTC, comment #8:
Yes it was the case, i gave the same name to a variable in my script, now it finally works well! Thank you very much!
Best regards,
Andre Fougeront
|
Mon 30 Nov 2015 03:25:13 PM UTC, comment #7:
When this error occurs, type "which function1" or "whos". Do you have a variable named function1? If I define both a function and a variable named function1, I get the same errors as you report here. This is the most common cause of this type of error, because Octave indexing and function calling use the same operator.
|
Mon 30 Nov 2015 03:16:32 PM UTC, comment #6:
To retake my example, with a resut named result1 and a function named function1. Whatever the content of the function if the input is a string it will give an error depending on the string, The first call of the function since the opening of octave will not trigger it and after the second time the bug will be triggered that way:
Hello,
finally the endfunction word at the end of the file was not enough to prevent the bug.
>> result1=function1('a')
error: A(I): index out of bounds; value 97 out of bound 1
>> result1=function1('aa')
error: A(I): index out of bounds; value 97 out of bound 1
>> result1=function1('aaaaaa')
error: A(I): index out of bounds; value 97 out of bound 1
>> result1=function1('aaaaaab')
error: A(I): index out of bounds; value 98 out of bound 1
>> result1=function1('aaaaaabc')
error: A(I): index out of bounds; value 99 out of bound 1
>> result1=function1('aaaaaabcb')
error: A(I): index out of bounds; value 99 out of bound 1
It will not depend on the number of characters but on the number of different type of characters, it is quite weird.
|
Thu 26 Nov 2015 03:30:55 PM UTC, comment #5:
Closing as invalid for now. Please feel free to open a new bug report if this or other problems arise.
|
Thu 26 Nov 2015 03:18:45 PM UTC, comment #4:
I think but i am not sure, I use the world function as an example I could have call it function1, but I forgot to put endfunction at the end of my script and I don t have any issue for now so I hope it is resolved! Maybe it was just the loading of functions that were not completely closed and prevent the function to load recursively. Indeed it may be a code issue and not an octave bug, I apologize.
|
Wed 25 Nov 2015 03:19:09 PM UTC, comment #3:
Is the entire problem you are reporting now resolved?
|
Wed 25 Nov 2015 02:52:12 PM UTC, comment #2:
Thank you very much, indeed i didnt knew the endfunction word was necessary :),
Best regards,
Andre Fougeront
|
Wed 25 Nov 2015 02:34:32 PM UTC, comment #1:
This is not a bug. You are using the word function wrong.
Function is a reserved word and is used as follows:
The way you are using it will not work.
|
Wed 25 Nov 2015 01:56:58 PM UTC, original submission:
Hello,
My issue is linked with my function call system, I am facing a bug that prevent me to use some function more than once before relaunching octave.
This bug do not depends on the function script, any function simple or not will trigger this bug if the input is a String (it wouldn t if it is an integer).
As an example starting at the second call of the function:
result=function('a String')
the function returns A(I): index out of bounds; value %% out of bound %%
And this value will change with the String size.
Moreover, I can also avoid the error by changing the name of the function and function file by for example call the function function1 and then
result=functionAnOtherName('a String')
would possibly work perfectly if I call it multiple time in a row.
So it is like my build is related to the issue and randomly create errors on some functions that take string in input(it could be some random function with random names).
Giving the script of any function will not help because I try on multiple kind of function clearly different (sometimes really simple like taking an input, don t use it, and returning result=1)
Like the system fail to get the input string or something like that.
I reinstalled octave multiple time and it didn t change anything.
Any idea on what part of octave on an ubuntu system could be related to this kind of bug?
Thank you,
Andre F
|