Problem 2866. Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places:
e.g. x = 2.3456 --> y = 2.346
Solution Stats
Problem Comments
-
3 Comments
Alireza yarmohammadi
on 19 Mar 2021
nice
but this problem is not in 2013 and downer versions
arsenic 陈
on 29 Mar 2021
answer:y = round(x,3)
why roundn not work?
goc3
on 29 Mar 2021
@arsenic 陈: roundn is a toolbox function. Cody only supports functions in basic MATLAB.
Solution Comments
Show commentsGroup

MATLAB JOINT CODY EVENT 2024
- 20 Problems
- 10 Finishers
- Slope intercept application
- findPositiveEvenNumbers
- Hemisphere Volume on Top of a Cylinder
- area
- Return area of square
- Potential energy calculation
- Volume and area of a sphere
- Create the following sequence : 0 1 1 4 9 25 64 169 ...
- Unique - Very Very Large Numbers
- Sum of series
- "mirror" matrix
- Pernicious Anniversary Problem
- Find Logic 20
- Remove element(s) from cell array
- Matlab Basics - Rounding II
- It dseon't mettar waht oedrr the lrettes in a wrod are.
- Are all the three given point in the same line?
- Is the Point in a Triangle?
- Counting Sequence
- Word Counting and Indexing
Problem Recent Solvers4964
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!