Returning error that there is not
2 views (last 30 days)
Show older comments
Hi,
I made this function
function [out] = pardin(N,T)
that contains a figure handle as structure with other handles; some of these are generated from for loop 'cause their position properties in figure are loop-depending;
So, if I edit this function and turn it in a simple m-file (providing variables called N and T, of course) it works, but if use it as above (as a function) it returns me this error:
Error using uitable
Width and height must be > 0
Error in uitable (line 52)
thandle = builtin('uitable', varargin{:});
Error in pardin (line 43)
S.w(jj,1) = uitable('Parent', S.fig, 'Data', A(:,:,jj), 'Units', 'normalized', 'Position', [0.7
1-((jj+jj+0.09)*0.1) 0.26 0.15 ]);
I think this is the error that it should return if 'Position' vector has 3rd and 4th element not positive, but my S.w handle, as you can observe, has those positive elements. How is it possible ? I tried to delete this handle and it returns same error for the other handles. As I wrote, if I use it as m-file script it works
4 Comments
Walter Roberson
on 21 Dec 2012
I was working on the hypothesis that jj might have a value that caused the Y to be out of range and the wrong error being returned.
Okay, with the same breakpoint in place, run until error, and then at the uitable level, please show us
varargin{:}
Accepted Answer
Walter Roberson
on 21 Dec 2012
The datatype of your variable "jj" is int8, and that is causing the Position calculation to be carried out in int8. That is resulting in the floating point values being rounded to integers, and [1 1 0 0] is the result.
Is there a particular reason you used int8 for that datatype? If not then just let jj be double. But if you need to, use
[0.7 1-((double(jj)+double(jj)+0.09)*0.1) 0.26 0.15 ]
Note that double(jj+jj) would be different than double(jj)+double(jj) if jj was 128 or larger.
0 Comments
More Answers (0)
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!