필터 지우기
필터 지우기

I am getting error Undefined function or variable, How to solve this error??

조회 수: 4 (최근 30일)
I am trying to run this code but I am getting error.
clear;
tic;
DataX = zeros(28709,2304,'single');
DataY = zeros(28709,1,'single');
fid = fopen('train.csv');
C = textscan(fid, '%d', 2305, 'Delimiter', '",', 'Headerlines',1, 'MultipleDelimsAsOne', 1);
DataX(1,:) = C{1}(2:end);
DataY(1) = C{1}(1);
for i = 2:28709
if mod(i, 1000) == 0
i;
end
C = textscan(fid, '%d', 2305, 'Delimiter', '",', 'MultipleDelimsAsOne', 1);
DataX(i,:) = C{1}(2:end);
DataY(i) = C{1}(1);
end
fclose(fid);
toc;
DataX = DataX./255;
im = write_grid_images(DataX, [48 48], [10 10], 2, 1);
myfclf(1); imshow(im);
save data.mat DataX DataY;
tic;
fid = fopen('test.csv');
C = textscan(fid, '%s', 'Delimiter', '" ', 'Headerlines',1, 'MultipleDelimsAsOne', 1);
fclose(fid);
toc;
CC =reshape(C{1}, 2304, 3589*2);
TestX = zeros(2304,3589*2,'single');
for i = 1:2304
for j = 1:3589*2
TestX(i,j) = str2double(CC{i,j});
end
end
TestX = TestX'./255;
im = write_grid_images(TestX, [48 48], [10 10], 2, 1);
myfclf(1); imshow(im);
save test.mat TestX;
This is the error
Undefined function or variable 'write_grid_images'.
Error in programm (line 22)
im = write_grid_images(DataX, [48 48], [10 10], 2, 1);

채택된 답변

Walter Roberson
Walter Roberson 2018년 1월 10일
You need to install https://github.com/HamedMP/deep-learning-faces to use write_grid_images()
  댓글 수: 1
saeeda saher
saeeda saher 2018년 1월 10일
편집: saeeda saher 2018년 1월 10일
Now installed write-grid-images() and added it into path file, the error is gone. Thank you

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Christoph F.
Christoph F. 2018년 1월 10일
The error means MatLAB cannot find the function write_grid_images().
Is it defined in a separate file or in the same file as the rest of the code?

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by