Borrar filtros
Borrar filtros

How to replace a character in matlab

2 visualizaciones (últimos 30 días)
Stina Ravdna Lorås
Stina Ravdna Lorås el 2 de Nov. de 2020
Comentada: Stina Ravdna Lorås el 4 de Nov. de 2020
I want to use the string v in the audiofile name etc in the code below (all the v's). Tried with num2str() but that works probably just for numbers?
vocals=["a"; "e"; "i"; "o"; "u"; "y"; "ae"; "oe"; "aa"];
for i=1:9
v=vocals(i)
[v, Fs] = audioread('v.wav');
v_filter=lpc(v, 9);
end;

Respuesta aceptada

Stephen23
Stephen23 el 2 de Nov. de 2020
Editada: Stephen23 el 2 de Nov. de 2020
vocals = ["a"; "e"; "i"; "o"; "u"; "y"; "ae"; "oe"; "aa"];
for k = 1:numel(vocals)
fnm = sprintf('%s.wav',vocals(k));
[v, Fs] = audioread(fnm);
v_filter = lpc(v,9);
end
  3 comentarios
Stephen23
Stephen23 el 4 de Nov. de 2020
@Stina Ravdna Lorås : please accept my answer if it helped you!
Stina Ravdna Lorås
Stina Ravdna Lorås el 4 de Nov. de 2020
I'm sorry, I didnt realize I had to. Now it is accepted :) Thank you again :)
Stina

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by