Question

Programming & user functions in MATLAB: Please provide the files & results in your submittal. Prepare a MATLAB program that f

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

clc%clears the screen
clear all %clears the history
format long;
time = input('Enter Time: ','s');
c=strsplit(time,":");
h = str2num(c{1});
c=strsplit(c{2},' ');
m = str2num(c{1});
if (h == 12)
h = 0;
end

if (m == 60)
m = 0;
end

hour_angle = 0.5*(h*60 + m);
minute_angle = 6*m ;
AngleBetween = abs(hour_angle - minute_angle);
if(AngleBetween>180)
AngleBetween=360-AngleBetween;
end
AngleBetween

MATLAB R2018a ② ▼| rch Documentation Log In EDITOR Find Files Compare ▼ Print Run Section New Open Save Advance Run and Find

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Programming & user functions in MATLAB: Please provide the files & results in your submittal. Prepare...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ Question Objectives After this homework assignment, students should be able to:  Implement user-defined structs...

    C++ Question Objectives After this homework assignment, students should be able to:  Implement user-defined structs using given specifications Use file input to populate structs Background While working to improve the LionPath website, you discovered a way to generate formatted text files that contains information about students' schedules for the upcoming semester. Consider the example below: FNAME: Andrew MINIT: S LNAME: Yu ID: 912345678 USER: auy77 CMPSC121-002-003L - M 9 05 AM 50 Lecture - T 10 05 AM 110...

  • What to submit: your answers to exercises 1, and 2 and separate the codes to each...

    What to submit: your answers to exercises 1, and 2 and separate the codes to each question. Create a MyTime class which is designed to contain objects representing times in 12-hour clock format. Eg: 7:53am, 10:20pm, 12:00am (= midnight), 12:00pm (= noon). You can assume the user will enter times in the format given by the previous examples. Provide a default constructor, a set method which is given a String (eg: “7:53am”), a getHours method, a getMinutes method and a...

  • Programming Assignment 1 Write a class called Clock. Your class should have 3 instance variables, one...

    Programming Assignment 1 Write a class called Clock. Your class should have 3 instance variables, one for the hour, one for the minute and one for the second. Your class should have the following methods: A default constructor that takes no parameters (make sure this constructor assigns values to the instance variables) A constructor that takes 3 parameters, one for each instance variable A mutator method called setHour which takes a single integer parameter. This method sets the value of...

  • Please can someone help me to finish this program? It is a C programming not a...

    Please can someone help me to finish this program? It is a C programming not a C++, when programming the program in linux I keep getting expected expression before || token, also please check if everything else is fine, maybe there is something else worng in my program and may ask me later to fix it, I am concern about the sin and cosine. The program is supposed to do all this: 1.Display a welcome message. 2.Prompt for the height...

  • Can someone please help me with the following java assignment. So in this assignment you will...

    Can someone please help me with the following java assignment. So in this assignment you will begin with the starterProject I provide and then add to it.  I am also asking that before you begin you really look at the starterProject because this is the object-oriented basics. The starterProject is the exact same as the ClassClockExample.zip in Module 5.  I’ve also done this using a clock because it is something that you already know how it works.  Remember that OOD and OOP is...

  • PLEASE I NEED C# Objectives Learn the basics of exception handling. Background Exceptions are essentially unexpected...

    PLEASE I NEED C# Objectives Learn the basics of exception handling. Background Exceptions are essentially unexpected situations. It is difficult to write a program that can handle all possible situations, as we have found out through the many programs we have written. For example, should your program accept accidental input? Does it use the metric system or the empirical system? Do users of your program know which system it uses? In order to deal with all these possibilities, exceptions were...

  • Object Oriented Programming Please write the code in C++ Please answer the question in text form...

    Object Oriented Programming Please write the code in C++ Please answer the question in text form 9.5 (complex Class) Create a class called complex for performing arithmetic with complex numbers. Write a program to test your class. Complex numbers have the form where i is V-I Use double variables to represent the private data of the class. Provide a constructor that enables an object of this class to be initialized when it's declared. The constructor should contain default values in...

  • Java Programming The program template represents a complete working Java program with one or more key...

    Java Programming The program template represents a complete working Java program with one or more key lines of code replaced with comments. Read the problem description and examine the output, then study the template code. Using the problem-solving tips as a guide, replace the /* */ comments with Java code. Compile and execute the program. Compare your output with the sample output provided. Modify class Time2 to include a tick method that increments the time stored in a Time2 object...

  • I need help with this assignment in C++, please! *** The instructions and programming style detai...

    I need help with this assignment in C++, please! *** The instructions and programming style details are crucial for this assignment! Goal: Your assignment is to write a C+ program to read in a list of phone call records from a file, and output them in a more user-friendly format to the standard output (cout). In so doing, you will practice using the ifstream class, I'O manipulators, and the string class. File format: Here is an example of a file...

  • Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture...

    Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture i sent is the first page 5. Write and save a function Sphere Area that accepts Radius as input argument, and returns SurfaceArea (4 tt r) as output argument. Paste the function code below. Paste code here 6. Validate your Sphere Area function from the command line, checking the results against hand calculations. Paste the command line code and results below. 7. Design an...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT