Parentheses error with a function call
古いコメントを表示
What is wrong with this function call? It's so basic but don't know what I am missing.
The error is "Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters."
load('mnist.mat', 'testX');
% save('testX'); commented it based on the reply I got for this question
x=testX; % testX is a 529*784 matrix
k=5; numIter=6;
[mu, cll, ill] = gmm(x, k,numIter)
% the function definition starts like this in another file
% function [mu,CLL,ILL] = gmm(x,K,numIter)
4 件のコメント
Walter Roberson
2021 年 5 月 10 日
編集済み: Walter Roberson
2021 年 5 月 10 日
That code looks okay.
save('testX'); % testX is a 529*784 matrix
Note that that save() call would save the entire current workspace to file testX.mat not just the testX matrix.
Walter Roberson
2021 年 5 月 10 日
I do not see any problem with the code extract that you posted.
Perhaps the error is inside gmm function .
採用された回答
その他の回答 (1 件)
Walter Roberson
2021 年 5 月 11 日
0 投票
[copying down from correct comment]
I do not see any problem with the code extract that you posted.
Perhaps the error is inside gmm function .
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!