save about 40 string to array and the save this array to file
조회 수: 1 (최근 30일)
이전 댓글 표시
hi how can i save about 40 string to array ( for example The names of 40 people) into variable(array) and then save these names into file and then Retrieve them back to array
댓글 수: 0
채택된 답변
Walter Roberson
2012년 12월 18일
편집: Walter Roberson
2012년 12월 18일
YourArray{1} = 'first string';
YourArray{2} = 'benchwarmer';
YourArray{3} = 'hot chocolate';
save('YourMATfile.mat', 'YourArray');
clear YourArray %to prove we got them back
TheData = load('YourMATfile.mat', 'YourArray');
YourArray = TheData.YourArray;
clear TheData
YourArray{3}
댓글 수: 0
추가 답변 (1개)
Jan
2012년 12월 19일
The commands needed to solve such basic tasks are explained exhaustively in the Getting Started chapters. It is required to read them, when you want to use such a powerful system like Matlab.
댓글 수: 1
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!