필터 지우기
필터 지우기

How to list variables in save() as an array of strings

조회 수: 9 (최근 30일)
alex barrie
alex barrie 2017년 12월 7일
댓글: alex barrie 2017년 12월 7일
I want to save a list of vars to a mat file, but the list of vars is not known until run time, such as:
vars = ['a', 'b', 'c']; save('fname', vars)
Is this possible?

채택된 답변

KL
KL 2017년 12월 7일
use a cell array,
vars = {'a','b','c'};
and then,
save('dummy.mat',vars{:})

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by