Returning error that there is not
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Walter Roberson
2012 年 12 月 21 日
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{:}
採用された回答
Walter Roberson
2012 年 12 月 21 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!