MATLAB Answers

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

조회 수: 9(최근 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일
@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
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. :-)

댓글을 달려면 로그인하십시오.

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by