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

2 次查看(过去 30 天)
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
编辑: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 CenterFile Exchange 中查找有关 Programming 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by