How is this code getting executed?

14 ビュー (過去 30 日間)
Varun Rahul Lale
Varun Rahul Lale 2021 年 10 月 1 日
コメント済み: Walter Roberson 2021 年 10 月 1 日
for i=1 : u
x(:,i) = y(:,ij(i-1))-y(:ij(i-2))
end
  4 件のコメント
DGM
DGM 2021 年 10 月 1 日
It's unclear what operations you're trying to do. Y is 10x7 and ij is 14x2. You want the result of yi-yj, neither of which are defined. Is this supposed to mean Y*ij(:,1) - Y*ij(:,2)? If so, the array size mismatch means that this won't work either as a matrix multiplication or as an elementwise multiplication. How does the loop example correspond to the problem statement?
Walter Roberson
Walter Roberson 2021 年 10 月 1 日
for i=1 : u
x(:,i) = y(:,ij(i-1))-y(:,ij(i-2))
end
You were missing a comma

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by