App Designer error Undefined function 'mtimes' for input arguments of type 'cell'.

6 visualizaciones (últimos 30 días)
I'm trying to reshape a 8x1280 matrix by stacking N columns
A %is some 8x1280 matrix
N = 128;
NewA = reshape(A, N*8, []); % 1024x10 matrix (128 cols of A stacked on top of each other x10)
the code above works just fine in my code.m file,but this error msg appears when I run the same code in the App Designer
Undefined function 'mtimes' for input arguments of type 'cell'.
So is there another way to reshape the matrix without using reshape function?!
*Edit
I tried this ,but gives error"Index in position 2 exceeds array bounds."
A=rand(8,1280);
NewA=[];
for n1=1:10
for n2=1:128
NewA(:,n1)=[ NewA(:,n1); A(:,n2)];
end
end

Respuesta aceptada

Steven Lord
Steven Lord el 16 de Dic. de 2019
Those commands work for me with a simple matrix. Show us the full and exact text of the error message you receive (include all the text displayed in red, and if there is any text displayed in orange show us that as well.
My suspicion is that while you think N is the scalar 128, it is in fact {128}. To confirm or rebut my suspicion, add the following line of code immediately before your reshape call and show us the output. [If your reshape call from your post is a simplified version, replace the A and N pieces with the names of the actual variables you use in your call.]
whos A N
  1 comentario
Omar Ashraf
Omar Ashraf el 16 de Dic. de 2019
OMG I can't thank you enough!
I was actually reading N from a txt file, and didn't know that it was read as a cell instead of a scalar!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by