how can i do this operation?

2 visualizaciones (últimos 30 días)
Firas Al-Kharabsheh
Firas Al-Kharabsheh el 1 de Mayo de 2016
Comentada: Firas Al-Kharabsheh el 1 de Mayo de 2016
if i have
M = [2 1
1 0
1 3
3 0
2 0 ]
AND
X = [ 2 0 0
1 1 1
4 0 0
1 0 0
2 1 0 ]
how can i calculate the F = | M - X | THEN F1 = sum(F)

Respuesta aceptada

CS Researcher
CS Researcher el 1 de Mayo de 2016
As you can see M and X are of different sizes, you cannot perform a subtraction operation on them. Maybe you can do this:
M = [M zeros(size(M,1),1)];
F = abs(M-X);
F1 = sum(F);

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown 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