Having issues with loops inside function.
古いコメントを表示
I want to create a function for finding the bounding box of images(rgb). The code works fine when I have it as a part of the main script. But when I implement it as a function it returns the value which I initialized with and not the values computed after the loops are executed. Which is why I have dummy variables and then assigning the return variables with their values. But this doesnt help me either.
5 件のコメント
Geoff Hayes
2015 年 4 月 5 日
Balakrishnan - please provide some code so that we can get an idea of what you have attempted and how best to go about solving the problem. Or just provide the function signature and how you are calling this function.
Balakrishnan Rajan
2015 年 4 月 5 日
編集済み: dpb
2015 年 4 月 5 日
dpb
2015 年 4 月 5 日
Have you stepped through with the debugger to check on the logic/values inside the function?
Looks like the loops could be replaced entirely with a suitable use of find and the 'first','last' optional inputs, btw.
Balakrishnan Rajan
2015 年 4 月 5 日
Balakrishnan Rajan
2015 年 4 月 5 日
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!