필터 지우기
필터 지우기

"Insufficient number of outputs from right hand side of equal sign to satisfy assignment."

조회 수: 269 (최근 30일)
Hi,
For a university project I'm having to code a K-Means clustering algorithm from scratch. As part of my code I have the following line:
[min, index] = min(NORMS);
On first run through of the code it works fine, but on the second iteration it always brings up the error "Insufficient number of outputs from right hand side of equal sign to satisfy assignment."
After clearing the variables and starting again it works fine, but again only for one iteration of the code.
Anyone have any ideas because I need to put it within a loop!
Cheers :)
  댓글 수: 1
Daniel Szucs
Daniel Szucs 2016년 10월 23일
If we want it work we just need to write following your example a : "clear min clear index"
before we call in the min function. In that case the code works.

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

채택된 답변

James Tursa
James Tursa 2015년 11월 11일
You likely have inadvertently created a variable named "min" in your code, which is shadowing the function min. Go find that variable and use a different name.
  댓글 수: 11

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

추가 답변 (1개)

BHANESH BHADRECHA
BHANESH BHADRECHA 2016년 1월 29일
편집: BHANESH BHADRECHA 2016년 1월 29일
that is because your output variable name and function name both are same.
for example
[stft, t, f]= stft(x,wlen,nfft);
in above function output variable in left hand side is stft and in right hand side function name is stft also.
so check this type of errors in your code.
or in matlab program you have created a variable which is already inbuilt function name of MATLAB.

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by