필터 지우기
필터 지우기

How to save each column in E drive of computer?

조회 수: 1 (최근 30일)
Faheem Ur Rehman
Faheem Ur Rehman 2021년 4월 15일
댓글: DGM 2021년 4월 15일
I have data of dimension (1024x10000) in workspace i want to save each column in my computer. after saving each column it should like (1024,1).
Thank you
  댓글 수: 4
DGM
DGM 2021년 4월 15일
What sort of files? .mat files? csv? something else?
Faheem Ur Rehman
Faheem Ur Rehman 2021년 4월 15일
i need .mat file

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

채택된 답변

DGM
DGM 2021년 4월 15일
Consider the simple example:
A=rand(500,10); % placeholder data
for f=1:size(A,2)
outname=sprintf('output_%06d.mat',f); % zero-padded sequential filenames
outvec=A(:,f);
save(outname,'outvec');
end
You'll have to adjust the file path and name as needed
  댓글 수: 2
Faheem Ur Rehman
Faheem Ur Rehman 2021년 4월 15일
thank you thats work
DGM
DGM 2021년 4월 15일
Yes. The example array is a placeholder to demonstrate the concept. I wasn't going to create 10000 files on my computer.
Instead of having a 500x10 array, you have a 1024x10000 array. Replace A with your array.

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

추가 답변 (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