"Insufficient number of outputs from right hand side of equal sign to satisfy assignment."
249 ビュー (過去 30 日間)
古いコメントを表示
Mike Suffield
2015 年 11 月 11 日
コメント済み: Sivylla Paraskevopoulou
2024 年 12 月 28 日
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 :)
2 件のコメント
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.
Sivylla Paraskevopoulou
2024 年 12 月 28 日
@Mike Suffield, this is not specific to training your network, but the trainnetwork function is no longer recommended. Use the trainnet function instead.
採用された回答
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.
12 件のコメント
その他の回答 (1 件)
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 Center および File 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!