Why am I getting this error about the number of input arguments when I have the right number of input arguments? Thank you!

1 回表示 (過去 30 日間)
lesser_green_matrix = LesserGreen.empty(0,0);
greater_green_matrix = GreaterGreen.empty(0,0);
for i = 1:V
for j = 1:V
disp(i);
disp(j);
lesser_object = LesserGreen(my_spin,i,j,hubbard,n,perm,t_values,w_values,combine_zero,chop_threshold);
lesser_green_matrix(i,j) = lesser_object;
greater_object = GreaterGreen(my_spin,i,j,hubbard,n,perm,t_values,w_values,combine_zero,chop_threshold);
greater_green_matrix(i,j) = greater_object;
end
end
Error message: Not enough input arguments.
Error in LesserGreen (line 28)
obj.spin = spin; % operator (i.e. "up" or "down")
  5 件のコメント
Christina Daniel
Christina Daniel 2022 年 9 月 29 日
Yes, I will attach, but it will have to be tomorrow morning pacific time since I don’t have access to the files right now. Thank you in advance for the help!
Christina Daniel
Christina Daniel 2022 年 9 月 29 日
For the record, the following link helped me solve part of the problem: https://www.mathworks.com/help/matlab/matlab_oop/initialize-object-arrays.html

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2022 年 9 月 29 日
Looks like it expects you to pass some arguments in to the spin() function. Can you attach the spin() function? What is it? Is it a spin button on your GUI? If so, maybe you mean app.spin.value or something?
  3 件のコメント
Christina Daniel
Christina Daniel 2022 年 9 月 29 日
Hmmm… maybe this is what I need to use? https://www.mathworks.com/help/matlab/matlab_oop/initializing-arrays-of-handle-objects.html
Walter Roberson
Walter Roberson 2022 年 9 月 29 日
編集済み: Walter Roberson 2022 年 9 月 29 日
No the error implies that spin is in the argument list defining LesserGreen but that you did not pass enough parameters to the function

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by