saving an variable into matlab for future use
3 次查看(过去 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!