What is an alternative for round(A, N) in version R2014a.

8 ビュー (過去 30 日間)
Ondrej Panek
Ondrej Panek 2016 年 11 月 9 日
コメント済み: Jan 2016 年 11 月 10 日
I am using a function round(A, N) in my code in version R2015b. But sometimes I need to use the same code in version R2014a for some reasons. But this lower version does not accept this function and I can not find any alternative. Is there any alternative in the version R2014a?
  1 件のコメント
Jan
Jan 2016 年 11 月 10 日
@Ondrej: If you take the time to search for "round" in this forum, you will find the posted solution fast. This is more efficient than asking again.

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

採用された回答

Star Strider
Star Strider 2016 年 11 月 9 日
I created this one for that purpose:
roundn = @(x,n) round(x .* 10.^n)./10.^n; % Round ‘x’ To ‘n’ Digits, Emulates Latest ‘round’ Function
It works the same way, and gives the same results as the built-in function.

その他の回答 (0 件)

カテゴリ

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