Problems
8.1 | Write a function ‘exchange’ to interchange the values of two variables, say p and q. Illustrate the use of this function in calling program. Test the function for p = 4.5 and q = 7.3. | ||||||||||||
8.2 | Write a function to evaluate:
Illustrate its use in a calling program. Test the function for x = 2 and no. of terms = 20. | ||||||||||||
8.3 | The Fibonacci numbers are defined recursively as follows:
Write a function that will generate and print the first ‘n’ Fibonacci numbers. Check the program to generate first10 Fibonacci numbers. Test the function for n = 10. | ||||||||||||
8.4 | Write a function that returns 1 if its argument is a prime number ... |
Get MATLAB® and Its Applications in Engineering: [Based on MATLAB 7.5 (R2007b)] now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.