0% found this document useful (0 votes)
34 views9 pages

HW1 - Matlab - 2016

This homework assignment introduces students to MATLAB through a series of problems involving matrices, vectors, plotting, and functions. Students are asked to write scripts for seven short problems and three longer problems, adding comments to identify each problem and explain the code. Solutions are to be submitted in a zip file containing MATLAB code scripts and associated output files like plots and command windows.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views9 pages

HW1 - Matlab - 2016

This homework assignment introduces students to MATLAB through a series of problems involving matrices, vectors, plotting, and functions. Students are asked to write scripts for seven short problems and three longer problems, adding comments to identify each problem and explain the code. Solutions are to be submitted in a zip file containing MATLAB code scripts and associated output files like plots and command windows.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

ELNG 204: MATLAB & LABVIEW for Electrical/Computer Engineering

(Second Semester-2016)
Assignment-1: Introduction to Matlab
Due: Wednesday, February 17, 2016 (10AM)
……………………………………………………………………………………………………..

This homework is designed to teach you to think in terms of matrices and vectors because this is how
Matlab organizes data. You will find that complicated operations can often be done with one or two lines
of code if you use appropriate functions and have the data stored in an appropriate structure. The other
purpose of this homework is to make you comfortable with using help to learn about new functions. The
names of the functions you’ll need to look up are provided in bold where needed

What to turn in: Copy the text from your both scripts and output and paste it into a document. If a
question asks you to plot or display something to the screen, also include the plot and screen output your
code generates. Submit either a *.doc or *.pdf file.

Submit all your codes in a “Zipfile” using “winrar” together with the pdf/word file. On top of your codes
comment ( % student name, Index Number, Assignment 1, Date )

For problems 1-7, write a script called shortProblems.mand put all the commands in it. Separate and
label different problems using comments.

Isaac Otchere 1
Isaac Otchere 2
Isaac Otchere 3
Isaac Otchere 4
Isaac Otchere 5
9. Throwing a ball. Below are all the steps you need to follow, but you should also add your own
meaningful comments to the code as you write it.
a. Start a new file in the Matlab Editor and save it as throwBall.m
b. At the top of the file, define some constants (you can pick your own variable names)
i. Initial height of ball at release = 1.5 m
2
ii. Gravitational acceleration = 9.8 m/s
iii. Velocity of ball at release = 4 m/s
iv. Angle of the velocity vector at time of release = 45 degrees
c. Next, make a time vector that has 1000 linearly spaced values between 0 and 1, inclusive.

d. If x is distance and y is height, the equations below describe their dependence on time and all
the other parameters (initial height h , gravitational acceleration g , initial ball velocity v , angle
of velocity vector in degrees θ ). Solve for x and y

Isaac Otchere 6
Isaac Otchere 7
10. Write a simple shuffling ‘encryption’ algorithm.

Isaac Otchere 8
Isaac Otchere 9

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy