フィルターのクリア

Incrementing certain values in a matrix for several iterations

4 ビュー (過去 30 日間)
Azrul Hafiz
Azrul Hafiz 2020 年 5 月 12 日
コメント済み: Azrul Hafiz 2020 年 5 月 15 日
Hi,
Im looking forward to increment specific columns of data by 2 in my Matrix for several rounds in a loop. The increment is not successful for each iteration in the loop as i hoped. It only shows the same set of data without incrementing by 2 for as long as the loop runs.

採用された回答

Bjarke Skogstad Larsen
Bjarke Skogstad Larsen 2020 年 5 月 12 日
I'm not sure exactly what you are trying to achieve but I think I can help you out anyway.
You are incrementing vp in each iteration but I'm guessing that you want all the variables you set after the first time you set vp to be affected by this change as well.
An easy way for you to achieve this with your current code:
  1. First, comment out line #35 : r has not been set yet, and you have the same code inside your for-loop.
  2. Move line #37 to line #6 to recalculate all your variables with the new value of vp
This will give you three results for values of vp: 48, 50 and 52
  1 件のコメント
Azrul Hafiz
Azrul Hafiz 2020 年 5 月 15 日
Sincerely thanks. Worked like a charm.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by