Matlab - Inner matrix dimensions must agree.

 
Vista:

Inner matrix dimensions must agree.

Publicado por cesar (1 intervención) el 04/08/2005 07:05:09
Hola.

Cuando ejecuto estas lineas de codigo en matlab 7.0

[s1, Fs, bits] = wavread('c:\Bio-Voz\Test\s1.wav')
S1 = FrameBlock(s1, 256, 100);
WinS1 = Windowing(S1);
fftS1 = fft(WinS1');
PowSpecS1 = abs(fftS1).^2;
NN = floor(128/2+1);
PowSpecS1 = PowSpecS1(1:NN, :);
imagesc(log(PowSpecS1));
axis xy;
m = melfb(20, 256, 12500);
melPowSpecS1 = PowSpecS1*m;
imagesc([0:129],[129:0],log(melPowSpecS1))

me sale el siguiente error y no me grafica :

??? Error using ==> mtimes
Inner matrix dimensions must agree.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Inner matrix dimensions must agree.

Publicado por Magaly (41 intervenciones) el 04/08/2005 10:13:14
Buscando en la ayuda de matlab la funcion mtimes, te dice cual es su sintaxis:

>> help mtimes
* Matrix multiply.
X*Y is the matrix product of X and Y. Any scalar (a 1-by-1 matrix)
may multiply anything. Otherwise, the number of columns of X must
equal the number of rows of Y.

C = MTIMES(A,B) is called for the syntax 'A * B' when A or B is an
object.

Haciendo una prueba con los vectores usados como argumentos en la funcion imagesc me daba el mismo error que a ti:

>> c=mtimes([0:129],[129:0])
??? Error using ==> mtimes
Inner matrix dimensions must agree.

>> c=mtimes([0:129],[129:0]')
??? Error using ==> mtimes
Inner matrix dimensions must agree.

Ahora, teniendo en cuenta la ayuda anterior: the number of columns of X must equal the number of rows of Y, la única posibilidad es trasponer el primer vector:

>> c=mtimes([0:129]',[129:0])

c =

Empty matrix: 130-by-0

No lo sé muy bien pero la solución puede estar en:

imagesc([0:129]', [129:0], log(melPowSpecS1))

????????????
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar