divide matrix with different sizes

19 visualizaciones (últimos 30 días)
mohamad almasi
mohamad almasi el 4 de Ag. de 2016
Comentada: Walter Roberson el 4 de Ag. de 2016
hi i wanna divide two matrix with different size one of them have 2 rows and 54 columns and another one have 2 rows and 16 columns. I'm trying element by element to divide but it's not appropriate. please help me what should I do with something like for loop or that kind of things.
thanks for devote your time for me

Respuestas (1)

Walter Roberson
Walter Roberson el 4 de Ag. de 2016
If the two matrices are A and B then possibly you want A\B (which will be 54 x 16) or B\A (which will be 16 x 54)
  5 comentarios
Stephen23
Stephen23 el 4 de Ag. de 2016
Editada: Stephen23 el 4 de Ag. de 2016
"unfortunately it's seem not appropriate for running in .m file"
Why would MATLAB not let you use MATLAB operators in a MATLAB function? Using MATLAB operations in MATLAB scripts and functions is not the problem. Check the dimensions of the variables before you call that command:
size(x)
size(T1)
arr_x = x\T1
Walter Roberson
Walter Roberson el 4 de Ag. de 2016
Your t appears to be mostly made up of toc() results. toc() is not measuring some kind of external time as the frames progress: toc() is measuring execution time of the MATLAB code itself, and those times can vary widely. For example,
>> tic;m = 6; toc
Elapsed time is 0.060407 seconds.
>> tic;m = 6; toc
Elapsed time is 0.000070 seconds.
Your use of toc for your t vector looks very suspicious to me.

Iniciar sesión para comentar.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by