to remove zero elements from n number matrices

12 ビュー (過去 30 日間)
Praveen Kumar Ramani
Praveen Kumar Ramani 2019 年 2 月 1 日
編集済み: Stephen23 2019 年 2 月 1 日
i have 112 matix in workspace say MT1,MT2,.....,MT112
refer attached image
lets take a matrix if all the three columns has zero entry i dont want those elements in cells,
how can i do the same for all matices
code plz
  1 件のコメント
Stephen23
Stephen23 2019 年 2 月 1 日
編集済み: Stephen23 2019 年 2 月 1 日
"code plz"
This has got to be a joke, right?
You just ignored the MATLAB documentation and advice from experienced users not to do this because it makes code complex, slow, and obfuscated:
And now, just ten minutes later, you have discovered that your code is so complex and obfuscated that you cannot even figure out how to perform simple operations on your data.
Do you think that perhaps this might have something to do with the advice that you have been given? The advice that you ignored?
You are wasting your time.

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

回答 (1 件)

KSSV
KSSV 2019 年 2 月 1 日
Let A be your matrix...to remove rows with all zeros use:
A(~any(A,2),:) = []
  3 件のコメント
Stephen23
Stephen23 2019 年 2 月 1 日
Use indexing. Just like we told you.
KSSV
KSSV 2019 年 2 月 1 日
I already told you...you need not to do that from cell.......it is waste of time.....

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by