How to make vector array value zero after certain index?

13 ビュー (過去 30 日間)
Afraz Khalid
Afraz Khalid 2021 年 1 月 31 日
コメント済み: madhan ravi 2021 年 1 月 31 日
Dear All,
I have an array from Simlunk which is 1001x4.
The first, second, third and fourth colum of array conatins the value of current, voltagee, Irradaince and Temperature.
Let say at index (555,1), the value of current start to becomes negative and keep on going in negative domain.
How do I make the value of current and volatge zero once the current start to get negative i.e. after value of current at (555,1)?

回答 (1 件)

madhan ravi
madhan ravi 2021 年 1 月 31 日
Matrix(556 : end, 1 : 2) = 0 % size 1001 X 4
  1 件のコメント
madhan ravi
madhan ravi 2021 年 1 月 31 日
Or:
Matrix(Matrix(:, 1) < 0, 1 : 2) = 0 % size 1001 X 4

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by