Unformatted text preview: Write a for loop that calculates the sum of the prime numbers from 1 to 1000. Note: you cannot use the primes function, although you may certainly use isprime( ) . “No Computer” Question 2: Imagine that we had a new data type called int7 , storing 7 bit signed integers. What’s the largest integer that int7 could store correctly? “No Computer” Question 3: Write a function called hereyougo that returns a 1x2 vector of random integers between 20 and 43. “No Computer” Question 4: You are given the following two Matlab functions: Blase.m Tianming.m function y = Blase(x) function y = Tianming(x) global s; global s; s = 15; y = 22 + (s  x); y = x+s; Write down the output I’d get if I typed the following command into the workspace after saving those functions. If there is an error, instead explain why there’s an error, and how I could fix it. Z = Blase(3) + Tianming(2)...
View
Full Document
 Fall '09
 blase
 Prime number, 7 bit, New Data Type, Matlab programming language, normal engineering account

Click to edit the document details