Creating a file containing 2 mat files

To run the weather generator Weagets I need to have an input file with at least two matrices for rainfall and number of years. These matrices will be (8x365) and (8x1). The program using the load function so it has to be a mat file (I think). I have created a mat file for each of the matrices. How do I combine them to one file or is there another way for me to do it?

답변 (1개)

Andreas Goser
Andreas Goser 2012년 2월 8일

0 개 추천

LOAD can also be used for loading ASCII formats, but yes the default is MAT.
When you have 2 different MAT files, then the way to create one MAT files including both matrices is to load both files and then write again one file.
Of course changing your code in a way to save only one file in the first place is recommended.
A=1;
B=2;
save myA A
save myB B
clear
load myA
load myB
save myAB A B
clear
load myAB

카테고리

도움말 센터File Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

질문:

2012년 2월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by