필터 지우기
필터 지우기

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 CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by