フィルターのクリア

Skipping 1st two calculations of a loop

1 回表示 (過去 30 日間)
Prakhar Modi
Prakhar Modi 2019 年 7 月 8 日
編集済み: dpb 2019 年 7 月 8 日
hi everyone,
i need to write a code like
for i=1:n
for j=1:k
C(i,j)= a(i)+b(j)+c(j)
end
end
but here i have to provide a particular value of C(1,1) and C(1,2). So is there a way i can skip these two calculation and start with j=3. But do remember when i=2 I want that j should start from 1:k. Only C(1,1) and C(1,2) I have to skip.
Thanks in advance

採用された回答

dpb
dpb 2019 年 7 月 8 日
編集済み: dpb 2019 年 7 月 8 日
for i=1:n
for j=1:k
C(i,j)= a(i)+b(j)+c(j)
end
end
C(1,1:2)=[C11 C12]; % fixup special cases
  2 件のコメント
Prakhar Modi
Prakhar Modi 2019 年 7 月 8 日
thank you
dpb
dpb 2019 年 7 月 8 日
Sometimes the answer is too obvious... :)

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by