"Unrecognized function or variable 'filename'. Error in audioread (line 82) filename = convertStr​ingsToChar​s(filename​);'

5 ビュー (過去 30 日間)
Marsha Groen
Marsha Groen 2021 年 7 月 24 日
コメント済み: Jan 2021 年 7 月 26 日
I am building the MIT Radar course, where you can download the doppler files. With the Doppler Files is a .wav file. I typed in
[Y, FS]= audioread('Off of Newton Exit 17.wav');
because this contains both variable values. I ran this last night and it worked. But I woke up this morning to run it again and it keeps giving me this 'Unrecognized function or variable 'filename' error. I tried using convertStringsToChars('Off of Newton Exit 17.wav') which it goes through, but it doesn't pull the variables like I need it to. it returns to the same error. I have tried changing the location, I have taken the entire address out of the audioread. Nothing has worked yet.
I looked up the error advising that the parsen is <0... I am absolutely stuck. Any help would be great. Thank you

回答 (2 件)

Jan
Jan 2021 年 7 月 24 日
編集済み: Jan 2021 年 7 月 24 日
Your variable "info" is a struct, not a char vector or string.
info = audioinfo('Off of Newton Exit 17.wav');
[Y, FS] = audioread(info.Filename);
Under Matlab R2018b your code fails also, but with a different error message.
  8 件のコメント
Jan
Jan 2021 年 7 月 25 日
@Walter Roberson: Do you mean:
dbtype audioread 1 % not fileread
Jan
Jan 2021 年 7 月 25 日
編集済み: Jan 2021 年 7 月 25 日
@Marsha Groen: Please post code as text and not as screen shots.
I asked you to copy my code carfully.
% My code:
info = audioinfo('Off of Newton Exit 17.wav');
% Your code
info = audioinfo('Off of Newton Exit 17.wav ');
% ^ additional space
Your code should fail with the error message:
% Error using audioinfo (line 51)
% The filename specified was not found in the MATLAB path.
Trailing spaces are not allowed for file names under Windows.
You have tried a lot of versions, which contain a variety of typos:
[data, FS] = audioinfo('Off of Newton Exit 17.wav');
[data, FS] = audioread('info');
[data, FS] = audioinfo(info;
[data, FS] = audioinfo(info);
[Y, FS] = audioread(info.Off of Newton Exit 17.wav);
info = audioinfo('Off of Newton Exit 17.wav ');
function [y,Fs] = audioread('Off of Newton Exit 17.wav', double);
[Y, FS] = audioread;
Programming languages are very susceptible for inserting some characters at the wrong locations. You have to crae for writing exactly want is needed. There is not fuzzy logic, which tries to fix such typos automagically.

サインインしてコメントする。


Jan
Jan 2021 年 7 月 25 日
編集済み: Jan 2021 年 7 月 25 日
A very bold guess:
Are you working with admin privileges? Did you open the file audioread.m and overwrite the first line of code, which should be
function [y,Fs] = audioread(filename, range, datatype)
How does the function start on your computer?
edit audioread
  8 件のコメント
Marsha Groen
Marsha Groen 2021 年 7 月 25 日
I had to uninstall the software and reinstall it on the PC instead of my external harddrive. It works now thank goodness. I appreciate all hands that were helping out, thank you for your time.
Jan
Jan 2021 年 7 月 26 日
You are welcome. Matlab problems are the purpose of this forum. The harder the problem, the more useful is the help. :-)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by