saving an variable into matlab for future use
2 ビュー (過去 30 日間)
古いコメントを表示
how is it possible to save an array of 1 row and 3 column. first column contain an integer, second column contain a string, third column contain an audio file.
basically i want to assign an audio file and a string to several variables. then when i select on the desired variable, it will display the string and play the audio file.
thanks for helping me out
0 件のコメント
回答 (1 件)
Iain
2013 年 7 月 16 日
Use cell arrays:
variable{1} = 4;
variable{2} = 'String';
variable{3} = 'D:\filehere\hi.wmv';
variable{4} = yourloadfunction('D:\filehere\hi.wmv'); %replace "yourloadfunction" with a file reading function you know and trust.
Alternatively, use a structure:
My_structure.Integer = 4;
My_structure.String = 'String';
My_structure.filename = 'D:\filehere\hi.wmv';
My_structure.file = yourloadfunction('D:\filehere\hi.wmv');
You can also use arrays of structures:
My_structure(2).Integer = 5;
etc etc.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Audio and Video Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!