how can i do this operation?

조회 수: 1 (최근 30일)
Firas Al-Kharabsheh
Firas Al-Kharabsheh 2016년 5월 1일
댓글: Firas Al-Kharabsheh 2016년 5월 1일
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)

채택된 답변

CS Researcher
CS Researcher 2016년 5월 1일
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);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by