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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by