How to append two datas of two different .mat files into one .matfile?
조회 수: 1 (최근 30일)
이전 댓글 표시
One .matfiel contains one feature having 1x20 coefficient and another .matfile contain only one value. Then how to append this two into one .mat file?
댓글 수: 0
답변 (2개)
Piyush kant
2019년 5월 29일
What i got from your question you have a variable suppose x=randi(1,20); which is 1x20 in size in "file1.mat". Another variable suppose y=31; in separate mat file"file2.mat" and you ned both to be in a single mat file which could be "newfile.mat".
For this you just need to load both the files for the variables to appear in workspace and use save command to save those into new variable.
x=load('file1.mat');
y=load('file2.mat');
save('newfile','x','y')
댓글 수: 1
Stephen23
2019년 5월 29일
Note that this will save the scalar structures x and y, which might not be the desired effect.
참고 항목
카테고리
Help Center 및 File 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!