Nt1310 Unit 5 Lab Report

Improved Essays
Pre-Lab 10
CS 122L - 5 Points Total

Objectives
● Learn how to use anonymous functions

● Practice with looping intervals

Deliverables
● Submit your pre-lab answers in Bblearn under the Lab 10 pre-lab assignment area.

1) The anonymous function allows us to easily create mathematical functions, and store them in variables. The documentation below provides additional details. http://www.mathworks.com/help/matlab/matlab_prog/anonymous-functions.html:

For example, let’s say we wanted to implement the equation x^2 +2*x +1. We could use an anonymous function to create a new function and store in in f:

f = @(x) x^2 + 2*x + 1;

Now, we can say f(3), and it will evaluate the function at 3 (plugging in 3 for all x).

a) Write the MATLAB code to create the function x^2 + 1, and evaluate that function at x = 5.
…show more content…
( f ( 5 ) )

the output of this function is: ans =

26
b) Write the MATLAB code to loop from 1 to 5, and evaluate the function from part a at each iteration (the first iteration will be f(1), second f(2), etc.). You can use the looping variable as an argument to be passed to f.

The MATLAB code to loop from 1 to 5 and evaluate the function from part a at each iteration is:

f=@ ( x ) ( x ^ 2 + 1 ) ;

for i = [ 1 : 5 ]

f ( i )

Related Documents

  • Improved Essays

    Nt1310 Unit 5 Lab Report

    • 483 Words
    • 2 Pages

    6/10/2015 Mrs Rummins | GRUJICIC, Marko Background: Another name for I/V characteristics is current-voltage. Current and voltage are the factors that are being investigated, there characteristics and effects in diodes of different colours. The Current or I in I/V characteristics refers to the flow of an electric charge.…

    • 483 Words
    • 2 Pages
    Improved Essays
  • Great Essays

    Question 1: a) A: Promoter B: Splice site C: 5’ UTR D: Start codon E: Stop codon F: 3’ UTR b) The sum of the exons and introns (all in kilobases) (1.2+8+0.7+27+0.4+11+3.1) = 51.4 kb. c) The sum of the exons (all in kilobases) (1.2+0.7+0.4+3.1) = 5.4 kb.…

    • 699 Words
    • 3 Pages
    Great Essays
  • Decent Essays

    Nt1310 Unit 2 Lab Report

    • 214 Words
    • 1 Pages

    On the way from solar cell to the solar module, the output efficiency decreases. For example when a multi-crystalline PV solar cells of 17.8% efficiency is used, the resulting efficiency of a module is around 15.9 to 16.3%. This decrease in efficiency is mainly because of three distinct losses listed below. 1. Optical losses generated by material reflectance and absorption 2.…

    • 214 Words
    • 1 Pages
    Decent Essays
  • Improved Essays

    Nt1310 Unit 4 Lab Report

    • 435 Words
    • 2 Pages

    b. When measuring the resistance value with the Avo 8, possible reasons for varience include a parallax error (not looking at the reading from directly above the meter), a reading error due to less divisions when measuring resistance, or the device not being properly zeroed. When measuring current, there are also fewer division, parallax is still a potential issue, and finally, incorrect zeroing of the meter. Voltage has an additional error, the loading of the meter itself. Alongside this issue, there is also parallax, zero, and accuracy/divisions.…

    • 435 Words
    • 2 Pages
    Improved Essays
  • Decent Essays

    Nt1310 Lab 3.07

    • 103 Words
    • 1 Pages

    1 Specialized mats and wrist straps help protect electronic components from __________. ESD or static electricity 2 What device is used to monitor temperature in the fuser assembly in a laser printer? Thermistor 3 __________ bundle wires to help keep them organized inside electronic devices.…

    • 103 Words
    • 1 Pages
    Decent Essays
  • Improved Essays

    Pt1420 Unit 4 Lab Report

    • 1693 Words
    • 7 Pages

    * For the first one this is what I would do... okay so we have the original equation for the first one & based off that this is what I would do... I would discover f ( 2 ) by inserting x equals 2. f…

    • 1693 Words
    • 7 Pages
    Improved Essays
  • Improved Essays

    Lower Sample Rate (22,050 SR, 128 kbps): 8/10 Since there was some slight static, we gave the sample a 8/10. This could have occurred because of the rustling of the recorders jacket. Since the phone was placed close to the recorder, this sound could have been easy to pick up by the recording device. I think if we were able to listen to the recording with headphones, it would have been a more accurate depiction of the quality. There was some breathing and wind sound that could be heard in the background noise, especially in the rainbow passage reading.…

    • 543 Words
    • 3 Pages
    Improved Essays
  • Improved Essays

    Nt1310 Unit 6 Lab

    • 1594 Words
    • 7 Pages

    My group had been given a specific task to investigate according to the lab manual1. We were employed by the Environmental Protection Agency as chemists. Our task is to identify an unknown compound that was found in a nearby landfill. In this laboratory, the unknown compound was given to us by our TA. The main goal of this experiment was to correctly identify the unknown compound.…

    • 1594 Words
    • 7 Pages
    Improved Essays
  • Decent Essays

    Nt1330 Unit 5 Test Paper

    • 597 Words
    • 3 Pages

    Student Name: Caroline machinjili THIRD YEAR DEGREE IN COMPUTING AT CCT DUBLIN SUBJECT: ADVANCED SWITHCING AND ROUTING PORTFAST AND ETHERCHANNEL October 2015 PORTFAST in my network I have setup portfast on all the 18 access switches connected to the workstations and also on the core switches connected to the servers. on both switches I have used ports fa0/1 to fa0/2. portfast on these ports will reduce the time the devices spend to connect to other devices on the network since these ports will not go through the spanning tree process of blocking, listening , learning and then forwarding which cause a delay of about 45 -50 seconds instead the ports will go straight to forwarding stage there by speeding up communication between devices in a network. for example in a company that have servers which provide services to clients. I have observed this process in my network and I will strongly recommend for the use of portfast.…

    • 597 Words
    • 3 Pages
    Decent Essays
  • Decent Essays

    Nt1330 Unit 1 Lab 2

    • 458 Words
    • 2 Pages

    On January 29th, we conducted lab 2 which involved learning the basic tools of Dartfish and how to publish Dartfish videos to our own mediabook. The first step in the lab involved going to dartfish.tv and looking at the “3302 Class Resources folder and downloading the video trim file. I then opened the Dartfish software and as a class we reviewed some of the various resources in the software like the different screen options such as split screen or mosaic mode and different tools such as analyzing angle and distance of the video. I learned how to transfer the downloaded video from the computer library to the tray. It’s important to note that you can delete videos from your tray and it will still be on the computer’s library.…

    • 458 Words
    • 2 Pages
    Decent Essays
  • Improved Essays

    Nt1310 Unit 4 Lab 4

    • 367 Words
    • 2 Pages

    The first objective of Lab 4 is to use structure activity relationships to predict the properties of an acid and the potency of hallucinogenic compounds. The overall goal of the laboratory is to examine quantitative structure activity relationships (QSAR) in a system that is either chemical or biochemical. The lab is divided into two parts; predicting the acidity of an organic acid, and predicting the hallucinogenicity of derivatives of mescaline. The materials of this lab for both part 1 and part 2 are small training sets, which are groups of similar chemicals with known biological activity, a computer to graph the data that is recorded in the tables, the internet resource MiLogP to generate LogP data, and computational programs that will…

    • 367 Words
    • 2 Pages
    Improved Essays
  • Superior Essays

    Pt1420 Unit 5 Lab Report

    • 1875 Words
    • 8 Pages

    Lab #5: Introduction to Metasploit on Kali Linux Team: CRYPTERS 1 d. Why is it usually a bad idea to operate in the Linux environment as root? If you are unfamiliar with the concept of the root user, do a quick google search. It is always a good practice on any operating system to run your applications on a user level and leave the administrative tasks to the root user, and only on a per-need basis. Applications are meant to be run by users with non-administrative privileges.(Power December 4, 2010)…

    • 1875 Words
    • 8 Pages
    Superior Essays
  • Improved Essays

    Pt1420 Unit 8

    • 925 Words
    • 4 Pages

    Initial Goals: My initial goals for the program was to take in an equation like 5*(4/3+2^(3-1)) and return the answer to it (26.666667 in this case). I intended it to work with simple arithmetic (multiplication, division, addition, subtraction, exponents, and parentheses). My initial brainstorming resulted in an iterative action. The program would follow the order of operations and begin with the contents of innermost parentheses and replace that portion of the input with the answer before moving one step out into what is now the innermost parentheses.…

    • 925 Words
    • 4 Pages
    Improved Essays
  • Improved Essays

    Nt1310 Unit 9 Lab Report

    • 812 Words
    • 4 Pages

    1. (8pts) From these data, graph your mean arterial pressure (MAP; see formula) and heart rate (y axes) vs. workload (in METS) on the x-axis (include resting results). Using this information, answer the following questions. Show ALL work. MAP…

    • 812 Words
    • 4 Pages
    Improved Essays
  • Improved Essays

    Trigonometric Functions

    • 1905 Words
    • 8 Pages

    Inverse Functions of Trigonometric Functions As high schoolers go their their teenage years of high school they learn from a variety of subjects. From math to science to history, there is a depth of knowledge to be learned. For math 3 and math 4, we are introduced to the world of trigonometry. So far, we have learned that there are currently three main trigonometric functions, cosine, sine, and tangent.…

    • 1905 Words
    • 8 Pages
    Improved Essays