フィルターのクリア

saving an variable into matlab for future use

3 ビュー (過去 30 日間)
genesis
genesis 2013 年 7 月 16 日
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

回答 (1 件)

Iain
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.

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by