Vector problem
1 回表示 (過去 30 日間)
古いコメントを表示
I have a (3,51)-sized vector, I would like to remove all data (set to zero) that does not belong to a certain interval,
x1 < x < x2
How can I do this efficiently?
Many thanks!
0 件のコメント
採用された回答
Fangjun Jiang
2011 年 7 月 22 日
A=rand(3,51);
Index=and(A<0.8,A>0.5);
A(Index)=0;
4 件のコメント
Sean de Wolski
2011 年 7 月 22 日
elements of A that are less than 0.8 AND those same elements of A greater than 0.5.
Jan
2011 年 7 月 22 日
@Susan: You could read the documentation "doc and" also. Do we assist to solve your homework?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Shifting and Sorting Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!