filteredreducedSection
sz = size(filteredreducedSection)
line one prints 106 columns and 90 rows
Line two gives an error:
Subscript indices must either be real positive integers or logicals.
sz = size(filteredreducedSection)
What gives? Thanks.

 채택된 답변

Star Strider
Star Strider 2016년 10월 27일

0 개 추천

Run this line in your Command Window:
which size -all
If the first result is:
size is a variable.
You’ve found the problem. (This is called ‘overshadowing’ of a funciton.) The solution is to rename your ‘size’ variable.

댓글 수: 3

Douglas Brenner
Douglas Brenner 2016년 10월 28일
편집: Star Strider 2016년 10월 28일
Found a few uses of size and SIZE but size still fails. which size -all is below. Says size is a variable but not in this program or called functions. Do I need to look in open files?
Subscript indices must either be real positive integers or logicals. Error in extract (line 46) q = size(filteredreducedSection)
>> which size -all
size is a variable.
size is a Java method % Shadowed java.util.ArrayList method
size is a Java method % Shadowed java.util.AbstractList method
size is a Java method % Shadowed java.util.AbstractCollection method
size is a Java method % Shadowed java.util.Collection method
size is a Java method % Shadowed java.util.List method
size is a Java method % Shadowed com.mathworks.mlwidgets.workspace.WhosInformation method
/Applications/MATLAB_R2014a.app/toolbox/matlab/datatypes/@table/size.m % Shadowed table method
/Applications/MATLAB_R2014a.app/toolbox/matlab/datatypes/@categorical/size.m % Shadowed categorical method
/Applications/MATLAB_R2014a.app/toolbox/matlab/iofun/@timer/size.m % Shadowed timer method
/Applications/MATLAB_R2014a.app/toolbox/matlab/iofun/@serial/size.m % Shadowed serial method
/Applications/MATLAB_R2014a.app/toolbox/matlab/polyfun/@triangulation/size.m % Shadowed triangulation method
/Applications/MATLAB_R2014a.app/toolbox/matlab/polyfun/@TriRep/size.m % Shadowed TriRep method
/Applications/MATLAB_R2014a.app/toolbox/shared/statslib/@dataset/size.m % Shadowed dataset method
/Applications/MATLAB_R2014a.app/toolbox/matlab/timeseries/@tscollection/size.m % Shadowed tscollection method
built-in (/Applications/MATLAB_R2014a.app/toolbox/matlab/elmat/size) % Shadowed
Douglas Brenner
Douglas Brenner 2016년 10월 28일
Had to close matlab and reopen. Maybe I should have just closed the program. Either way a matlab bug?
Star Strider
Star Strider 2016년 10월 28일
Not a bug at all.
This is the problem:
>> which size -all
size is a variable.
You have to find the ‘size’ variable in your code and rename it. The easiest way is to use the Editor, go to ‘Navigate’ —> ‘Find’ then search on either:
size= -or- size =
depending on your programming style. That should find it. Then rename it to something that makes sense in the context of your code. The Editor should then offer you the opportunity to change all the other uses of your ‘size’ variable. Be careful that you don’t accidentally rename your calls to the size function. (I don’t know if the Editor makes that distinction itself, since I never did it myself and I never tested it.)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

질문:

2016년 10월 27일

댓글:

2016년 10월 28일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by