how to replace zeros's with o.1 in the ouput?
1 回表示 (過去 30 日間)
古いコメントを表示
raghavendra kandukuri
2018 年 9 月 27 日
コメント済み: Star Strider
2018 年 9 月 27 日
I have a calculation, which will generate a output(Duration) in text file, in the generated output, it does generates lots of zeros which i want to replace them with 0.1, how do i do that? PFA.
for i = 2:holder
duration(i)=(fielddatatime(i)-fielddatatime(i-1));
if
%expected calculation
end
end
0 件のコメント
採用された回答
Star Strider
2018 年 9 月 27 日
Try this:
duration = randi([0 9], 1, 15) % Create Vector
duration(duration == 0) = 0.1
duration =
9 0 4 0 8 7 1 4
duration =
9 0.1 4 0.1 8 7 1 4
4 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!