Question: Write a user-defined MATLAB function that converts integers written in decimal form to binary form. Name the function b=Bina (d), where the input argument d

Write a user-defined MATLAB function that converts integers written in decimal form to binary form. Name the function b=Bina (d), where the input argument d is the integer to be converted and the output argument b is a vector with 1 s and Os that represents the number in binary form. The largest number that could be converted with the function should be a binary number with 16 1 s. If a larger number is entered as d, the function should display an error message. Use the function to convert the following numbers:
(a) 100
(b) 1002
(c) 52,601
(d) 200,090

Step by Step Solution

3.29 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Script file disp Part a d100 b Bina d if b0 disp The binary decomposition is ... View full answer

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

Document Format (1 attachment)

Word file Icon

652-B-F-F-M (737).docx

120 KBs Word File

Students Have Also Explored These Related Finance Questions!