casewrite
ケース名のファイルへの書き込み
説明
casewrite( は、文字配列または string 列ベクトル strmat,filename)strmat の内容をファイル filename に書き込みます。strmat の各行は 1 つのケース名を表します。casewrite は filename に名前を 1 行ずつ書き込みます。filename に、ファイル名 (現在のフォルダーに書き込む場合) または絶対パス名 (別のフォルダーに書き込む場合) を指定します。
filename のファイル拡張子は、次のいずれかである必要があります。
.txt、.dat、または.csv(区切り形式のテキスト ファイル).xls、.xlsm、または.xlsx(Excel® スプレッドシート ファイル)
casewrite( を実行すると、[書き込むファイルを選択] ダイアログ ボックスが開き、書き込むファイルを対話形式で指定できます。strmat)
例
入力引数
代替機能
casewrite と caseread を文字配列と使用する代わりに、writecell と readcell を cell 配列と使用することを検討してください。以下に例を示します。
months = {'January';'February';'March';'April';'May'};
writecell(months,'months.dat')
names = readcell('months.dat')names =
5×1 cell array
{'January' }
{'February'}
{'March' }
{'April' }
{'May' }
バージョン履歴
R2006a より前に導入