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/26 01:41:04
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('
xSkAW"[$_*BI2 fgAO&Dl5T U"DPJi?3/RX{f nR,'m6aӏ|[x7xZ*En91庍0C>׬ll1ߏS4iڮM-yޒ&M=l`A@x*g8Tf qIzΆmpDƽ\".A匜" uM4]$}- $ ]DzO7WC,!= DwHjZ5چc ⺼` ^ugΡ-,v/w}>$bp58H4`0^< .EOp|A_xlfaSwج]lv ^?26ĞT]ՂҤL nWi ף[*2K/Q43/u28R&˽DL/Y5B;X

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'));
试一下.多了一个'\'