Question: Matlab code only write a code of your own to round any number to any required digit. The numbers are written in the first column

Matlab code only

write a code of your own to round any number to any required digit. The numbers are written in the first column of an excel document (Round.xlsx) in a sheet named "numbers", while the second column has the specified rounding digit.

It is recommended that you split the matrix into two different vectors (call the first vector numbers and the second digits).

Apply your programming skills and your knowledge of MATLAB commands to round the numbers in the vector numbers to their corresponding digits in the vector digits.

When you round the numbers, add a new column to the existing matrix Table and put your rounded answers in it.

Write the new matrix to the same Excel document to a sheet named YourLastName, as shown in Figure 1 (b).

You can ONLY use (length, size, relational operators { ~=}, logical operators {|, &}, if, for, while and switch).

At any point in this code you shouldnt use any built-in functions (such as: round, ceil, floor, fix, max, min,

etc).

Your code should deal with any matrix size

Matlab code only write a code of your own to round any

Matlab code only

please help

I just need some help on where to start or how to write this using if statements with out using the built in function ROUND or anyother.

The help given was to divide the digit used by 100 or another digit to transform it to a decimal. like 100 divided by 100 would give me the decimal place of 1 and be round to that value. Each value can only be incremented in values of 0.5 in order for this to work.

Say we are given 52.67 we know that the .67 belongs to the remainder. but i do not know what I can do in an if statement or for loop to form a code to make that work to round this number to anything.

"round to the nearest interger" "divide by 100" "signal -1 and +1" "compare to 0.5" "extract the interger from the decimal"

--> xlsread

-->split column

--> for loop

------> singal

------->compare one case at a time>>??

-----?> for loop increments

matrix (nx3)

example

-52.67327

signal = -1

52.67327

compare to 0.5

(( 53 * 100))

answer = 5300

then move on to the next case

but i need to find a code that does this . please help me

it can not use any built in functions needs to use == for if while and things like this

all while extracting and importing from an excel file.

I mainly need help with the code part for the rounding please

in matlab

, HorlInsi Pag For Dat RevlVie, ( -X Hor!Insel Pag For! Dat Rer! Vie.@ X - Font Alignment Number Styles Cells Font Alignment Number Styles Cells Clipbo... F23 8.4726 0.382 3 3.3231 0.1 0.01 4 0.55410.001 8.4726 0.382 3 3.3231 0.1 0.01 4 0.55410.01 3.32 0.554 5 1.1656 9.8815 5 1.1656 100 100 7 8.3379 0.001 0.001 0.01 9.8815 78.3379 0.0018338 0.001 0.01 3.8052 9 11.4027 10 0.4134 11 12587 12 14524.23 0.7 3.805 9 11.4027 10 0.4134 11 12587 12 14524.23 13 14 15 16 0.345 17 18 19 10 12590 100 14500 100 13 0.7 15 16 -0.345 17 18 19 0.01 0.010.35 78.6 43.5 100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!