What does the error outpur argument not assigned during call mean?

조회 수: 1 (최근 30일)
Ashutosh
Ashutosh 2013년 8월 26일
Please see the above images. I created a simple function in which I calculated values of array members by using variables defined in the calling function. It worked. I applied the same logic here, but it shows this error.

답변 (1개)

Walter Roberson
Walter Roberson 2013년 8월 26일
Suppose you were to pass in 1 for m. Then because your second loop has an upper bound of m-1, that would be an upper bound of 1-1=0 and so would not execute at all, so you would not have assigned a value to "a". Likewise your third loop goes from 2:m so if m was 1, the loop would not be done at all, leaving another variable never assigned to.
  댓글 수: 2
Ashutosh
Ashutosh 2013년 8월 26일
편집: Ashutosh 2013년 8월 26일
I have a program wherein I have defined the arrays in same fashion(above image). It worked fine. The same program i am trying to break into small functions. Why the error now? What should I do to solve this error?
I tried this also. I kept only the d array in the matrix_vor file. I am now just finding d(i) values and printing them. but still i get the same error. http://imageshack.us/photo/my-images/51/dgls.jpg/
Walter Roberson
Walter Roberson 2013년 8월 26일
You have not shown us what value you are passing in for "n"
At the command line, give the command
dbstop if error
and then run your program. When it stops with the error, display the value of n that the routine has received.

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

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by