Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MATLAB子批函数sys输入参数过多_Matlab - Fatal编程技术网

MATLAB子批函数sys输入参数过多

MATLAB子批函数sys输入参数过多,matlab,Matlab,我在MATLAB中有一个脚本,它使用了子图函数。现在我知道,正如我在MATLAB文档中看到的那样,至少需要3个参数才能工作。但是,它给出了一个错误,说明输入参数太多。这是密码 %% ================= Part 5: Image Compression ====================== % Find closest cluster members idx = findClosestCentroids(X, centroids); % Essentially, n

我在MATLAB中有一个脚本,它使用了子图函数。现在我知道,正如我在MATLAB文档中看到的那样,至少需要3个参数才能工作。但是,它给出了一个错误,说明输入参数太多。这是密码

%% ================= Part 5: Image Compression ======================


% Find closest cluster members
idx = findClosestCentroids(X, centroids);

% Essentially, now we have represented the image X as in terms of the
% indices in idx. 

% We can now recover the image from the indices (idx) by mapping each pixel
% (specified by its index in idx) to the centroid value
X_recovered = centroids(idx,:);

% Reshape the recovered image into proper dimensions
X_recovered = reshape(X_recovered, img_size(1), img_size(2), 3);

% Display the original image 
subplot(1, 2, 1);
imagesc(A); 
title('Original');

% Display compressed image side by side
subplot(1, 2, 2);
imagesc(X_recovered)
title(sprintf('Compressed, with %d colors.', K));
在“%Display the original image section”(显示原始图像部分)处,它给出了一个错误消息

Error using subplot
Too many input arguments.
Error in ex7 (line 162)
subplot(1,2,1);

我无法理解为什么MATLAB会给出这样一个错误。请解释。

看起来您有另一个同名函数。 在同一文件中搜索子函数或搜索全局文件:

which subplot -all

在本地目录中是否有一个名为subplot的文件?请说出哪个subplot的结果