Empty matrix: 1-by-0, MSE

13 ビュー (過去 30 日間)
DongShin Yang
DongShin Yang 2016 年 4 月 20 日
回答済み: Walter Roberson 2016 年 4 月 22 日
Hello, I have been a test of MSE.
I am currently experimenting with using the Find function.
I sometimes following error occurs during repeated experiments with the wrong MSE results
Empty matrix: 1-by-0
So, I modify the code as follows.
h_DSiidkukeiseisu = h_DSiidkukei * 1000; %少数点を整数化
[h_DSiidkukeiTk]= find((abs(h_DSiidkukeiseisu))>=1); %Tk_DS%浮動小数点の丸め誤差が原因を防ぐ
But it seems there is a problem yet.
I need to find a value of the vector(non-zero).
Please check the code.
  1 件のコメント
DongShin Yang
DongShin Yang 2016 年 4 月 21 日
I missed 0 for 1000. I revised the code. h_DSiidkukei * 10000

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

採用された回答

Walter Roberson
Walter Roberson 2016 年 4 月 22 日
Your code is not looking for non-zeros. Your code is looking for locations where the absolute value is at least 1. That is not going to find anything if all of the values are zero, or if all of the non-zero values have absolute value less than 1.

その他の回答 (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