How to delete row or column in x.mat file

조회 수: 5 (최근 30일)
shawin
shawin 2020년 10월 22일
댓글: Ameer Hamza 2020년 10월 22일
Hi,
I have a X.mat file, its big mat file.
how can i delet the rows ( specific row ) !! for example;
row : 600 to 3000 delete
or column 25 to 35 delete
I tried The code below but did not work :
X = importdata('X.mat');
X([501,2000],:) = [];

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 10월 22일
편집: Ameer Hamza 2020년 10월 22일
Does X.mat file only have one variable? In that case, try
X(501:2000,:) = [];
%^ put : here
Also, If the variable is very large, then it may be faster to modify the mat file without loading directly
data = matfile('X.mat', 'Writable', true);
data.X(501:2000,:) = [];
  댓글 수: 2
shawin
shawin 2020년 10월 22일
편집: shawin 2020년 10월 22일
@Ameer Hamza, Cannot change 'X' because Properties.Writable is false. To modify 'X', set Properties.Writable to true. ??what properties ?? the file is 5000x64
Ameer Hamza
Ameer Hamza 2020년 10월 22일
I missed to change the Writable property. Check the updated answer.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by