필터 지우기
필터 지우기

Remove .mat variable image data

조회 수: 1 (최근 30일)
Md Shamim Hossain
Md Shamim Hossain 2017년 6월 21일
답변: Walter Roberson 2017년 6월 21일
whos('-file','data_batch_1.mat')
Name Size Bytes Class Attributes
batch_label 1x21 42 char
data 10000x3072 30720000 uint8
labels 10000x1 10000 uint8
When I analyze my .mat file It has three variable. In the data variable. I want to remove the image inside the data variable and keep my won 10000 image data in same Size, same Bytes and same Class. Anyone can help me providing Matlab code.
  댓글 수: 2
KSSV
KSSV 2017년 6월 21일
Not clear with question.....in .mat file there are three variables, you need to delete few variables out of it?
Md Shamim Hossain
Md Shamim Hossain 2017년 6월 21일
In Data variable contains 10,000 images. I want to remove all images inside Data variable and keep my won 10,000 images in same size 10000x3072 and same class uint8.

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

답변 (1개)

Walter Roberson
Walter Roberson 2017년 6월 21일
filename = 'data_batch_1.mat';
filestruct = load(filename);
filestruct.data(:) = 0; %removes all useful content, preserving size and data class
save(filename, 'filestruct', '-struct'); %write the variables back to the file

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by