Elementwise subtraction .- does not work

9 ビュー (過去 30 日間)
gehoon
gehoon 2016 年 4 月 1 日
コメント済み: Walter Roberson 2016 年 4 月 1 日
Hi, what would be causing following errors?
[1 3; 4 5] - [2 3] : dimension must agree Error
[1 3; 4 5] .- [2 3] : unknown operator ".-" Error
How could I operate following:
matrix A [m * n] - vector B [1 * n],
so that A(:,k) - B(k) = matrix [m * n]
This should be easy with .- operator but my MatLab refuses to cooperate.
Using MATLAB 2016a
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 4 月 1 日
There is no .- or .+ operator. The "." prefix is not a modifier that can be applied to any other operator: each of the operators that start with "." are defined individually.

サインインしてコメントする。

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 4 月 1 日
bsxfun(@minus,[1 3; 4 5],[2 3])

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by