MATLAB的一个小问题Files = dir(fullfile('C:\Users\Administrator\Desktop\MIT人脸库\nonfaces\\','*.bmp'));LengthFiles = length(Files);imagearray = zeros(20,20,LengthFiles);%Img=zeros(20,20)for i = 1:LengthFiles;imagearray(:,:,i)=imread(strcat('
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/24 05:25:42
MATLAB的一个小问题Files = dir(fullfile('C:\Users\Administrator\Desktop\MIT人脸库\nonfaces\\','*.bmp'));LengthFiles = length(Files);imagearray = zeros(20,20,LengthFiles);%Img=zeros(20,20)for i = 1:LengthFiles;imagearray(:,:,i)=imread(strcat('
MATLAB的一个小问题
Files = dir(fullfile('C:\Users\Administrator\Desktop\MIT人脸库\nonfaces\\','*.bmp'));
LengthFiles = length(Files);
imagearray = zeros(20,20,LengthFiles);
%Img=zeros(20,20)
for i = 1:LengthFiles;
imagearray(:,:,i)=imread(strcat('C:\Users\Administrator\Desktop\MIT人脸库\nonfaces\',Files(i).name));
%Imgs=rgb2gray(Img);
%imagearray(:,:,i)=Img;
end
我想将一个文件夹里的图片都读出来然后保存到一个三维数组里,图片是BMP格式的,大小是20*20的,为什么运行之后提示
Assignment has more non-singleton rhs dimensions than non-singleton
subscripts
MATLAB的一个小问题Files = dir(fullfile('C:\Users\Administrator\Desktop\MIT人脸库\nonfaces\\','*.bmp'));LengthFiles = length(Files);imagearray = zeros(20,20,LengthFiles);%Img=zeros(20,20)for i = 1:LengthFiles;imagearray(:,:,i)=imread(strcat('
第一行你笔误了.
Files = dir(fullfile('C:\Users\Administrator\Desktop\MIT人脸库\nonfaces\\','*.bmp'));
改成
Files = dir(fullfile('C:\Users\Administrator\Desktop\MIT人脸库\nonfaces\','*.bmp'));
试一下.多了一个'\'