Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how can i solve this error : Error using / Not enough input arguments.

조회 수: 7 (최근 30일)
Hira Abid
Hira Abid 2018년 7월 1일
마감: MATLAB Answer Bot 2021년 8월 20일
stuck in following line of code and facing this error message
aspect_ratio = results(index).MajorAxisLength /results(index).MinorAxisLength arr(k,1)=aspect_ratio
i have tried using "./" instead as well as putting ";"in end of code but error does not solved. help me in this regard.
  댓글 수: 1
Jan
Jan 2018년 7월 1일
Aren't these two lines of code?
aspect_ratio = results(index).MajorAxisLength /results(index).MinorAxisLength;
arr(k,1) = aspect_ratio;

답변 (1개)

Jan
Jan 2018년 7월 1일
Use the debugger to examine the problem: How to use the debugger
Set a breakpoint in the failing line - after fixing the problem that these are two lines (see my comment above). Or let Matlab stop automatically when the error occurs by typing this in the command window:
dbstop if error
Now run the code again. When Matlab stops, check the locally used variables:
class(results)
size(results)
class(index)
size(index)
I guess, that index is empty. Then results(index).MajorAxisLength has no element, such that you do not have an input for the division.
  댓글 수: 1
Hira Abid
Hira Abid 2018년 7월 1일
this the whole code, but the error occurs in these lines. t thought the same that index is empty. since i'm new to matlab so i dont know how to solve it.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by