フィルターのクリア

Copying values in array

2 ビュー (過去 30 日間)
wswur
wswur 2017 年 7 月 4 日
コメント済み: dpb 2017 年 7 月 4 日
I have a small questions regarding copying some values and pasting them in the same array, but then on a different position. From position (A,B) till the end of the array, values are written in the array. I want to copy these values in such a way that the entire array is filled up with the exact same values as from the position (A,B). The problem is that now the values are only replaced from its position instead of copied. Hope someone can help me out!
for ii = A:length(complete_ellipse(A,:))
for jj = B:length(complete_ellipse(B,:))
complete_ellipse(ii-A+1,jj-B+1) = complete_ellipse(ii,jj);
complete_ellipse(ii-A+1,jj) = complete_ellipse(ii,jj);
complete_ellipse(ii,jj-B+1) = complete_ellipse(ii,jj);
end
end
  1 件のコメント
dpb
dpb 2017 年 7 月 4 日
I don't quite follow -- is the array prefilled and you're trying to move a given portion to somewhere else or trying to fill a section from a starting point to end with a constant value from that start point?
Show us a small sample input array and then the desired result and the rule by which get to the end from the start.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by