problem generating audio file from "From File" block in simulink

5 ビュー (過去 30 日間)
Ahmed
Ahmed 2013 年 3 月 5 日
hi, here is what in my m-file:
[sound,fs] = wavread('admirer.wav');
r = sound';
save ('wavplay.mat','r');
the problem is after adding this to "From File" block in simulink, this error appears:
"Simulink does not support loading the input data in file 'wavplay.mat'. For data saved using MAT file versions prior to 7.3, Simulink can only load two-dimensional arrays consisting of one-dimensional, double, noncomplex samples. To load data of any other type, complexity or dimension, use a timeseries object and save the file using MAT file version 7.3 or later. For example, use: 'save file_name -v7.3 timeseries_object'."
as i wanted to take the output of this block to "PWM" block of Arduino target hardware.
thank you in advance!

回答 (1 件)

TAB
TAB 2013 年 3 月 6 日
To load workspace data using From workspace block, you data should be in time series format (A time series object OR array with time OR structure with time).
See the examples at the last of this page.
To understand, take a Workspace block in model and save some data using it into workspace. Analyse the saved data.

カテゴリ

Help Center および File ExchangeRun on Target Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by