Write a function program and main script that perform the following steps: 1. Write a function...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a function program and main script that perform the following steps: 1. Write a function file that takes two array (X, Y) and one char variable (op) as inputs and it returns variable Z. Formula for Z is given below N op 1 z 2X(k)²/k! = A=0 • op=2 Z = X²+Y² X+Y op-3 Z= [X² Y³] N is the size of vector X and Y. if op is not one of the options above, the program will warn the user. 2. Write a main script that calls the function with two column vectors having random numbers between [0-1] with length N where N is a random integer number and a char variable taken from the user. Let assume that your main script stores the output of the function in variable T. Print the screen ⚫ size of T . ⚫ maximum element of T ⚫ minimum element of T • Hint: use num2str for converting a number to a char variable Cevap Sorunun cevabını buraya giriniz. Write a function program and main script that perform the following steps: 1. Write a function file that takes two array (X, Y) and one char variable (op) as inputs and it returns variable Z. Formula for Z is given below N op 1 z 2X(k)²/k! = A=0 • op=2 Z = X²+Y² X+Y op-3 Z= [X² Y³] N is the size of vector X and Y. if op is not one of the options above, the program will warn the user. 2. Write a main script that calls the function with two column vectors having random numbers between [0-1] with length N where N is a random integer number and a char variable taken from the user. Let assume that your main script stores the output of the function in variable T. Print the screen ⚫ size of T . ⚫ maximum element of T ⚫ minimum element of T • Hint: use num2str for converting a number to a char variable Cevap Sorunun cevabını buraya giriniz.
Expert Answer:
Answer rating: 100% (QA)
Function to perform operation based on given char var... View the full answer
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date:
Students also viewed these programming questions
-
What is the net electric charge of this object? Note for advanced students: you can assume charge is measured in any convenient units, e.g. coulombs or units of e. Write down only the number part of...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
Review the following exhibits for Kitchenmaid: (Click the icon to view the functional cost breakdown.) (Click the icon to view the customer feature ratings.) m link the innn in this site function...
-
The demand functions for two related products, product A and product B, are given by qA = 400 - 2pA -3pB qB = 300 - 5pA -6pB where pA and pB are the respective prices in dollars. (a) Find the...
-
Identify which geometric series converge. Give the sum of each convergent series. 64 + 16 + 4 + 1 +...
-
One possible check on administrative agency power is transparency. What does transparency mean in the context of government regulation? What specific laws and government websites help ensure that...
-
Manufacturing cost data for Meneses Company, which uses a job order cost system, are presented below. Indicate the missing amount for each letter. Assume that in all cases manufacturing overhead is...
-
56. If the maximum concentration of PbCl2 in water is 0.01M at 298 K. Its maximum concentration in 0.1M NaCl will be : (1) 4 103 M x (3) 4 102 M (2) 0.4 10M x (4) 410 M
-
Suppose you have a list of blood platelet counts from 500 patients in a hospital. Which of the following is most helpful in understanding the distribution of those values: frequency table, pie chart,...
-
Q7. In a particular company the salary of a technician (x1000) is X ~N(= 30,0 = 2). The salary of an engineer is X2 ~N(= 40, = 3.5). (i) For a group of 25 technicians, calculate the probability that...
-
Execution & Measurement - When will you execute your campaign and why? Provide a detailed implementation chart Why did you select these dates for your campaign? How will you measure the success of...
-
Describe the term "Time of performance" (delivery date) Why do you think this term is required and what happens if the term is not met? List an example of how this term may play out in real life.
-
Legal, as well as moral challenges, often arise when natural/man-made disasters and emergency situations result in the scarcity of healthcare resources. Serious legal, health, and economic impacts...
-
Critically discuss how criminal activities have changed in the information age (computer age).
-
Discuss the aims of sentencing - punishment, rehabilitation, reparation, deterrent. (individual and general)
-
Prepare journal entries to record these transactions. (Credit account titles are automatically indented when amount is entered. Do not indent manually. If no entry is required, select "No Entry" for...
-
Do the three planes x + 2x + x 3 = 4, X X 3 = 1, and x + 3x = 0 have at least one common point of intersection? Explain.
-
Solve the system using Gauss elimination with pivoting. Determine the solution x and the determinant of the original matrix, A. 3 3 - 1 -1 -2 4 2 4 5 4 1 2 0 3-2 3 1 X1 0 X2 8 ][-] X3 2 X4 14
-
Solve the IVP with y(0) = 0 using ode45. dy dt = e~! (4.10.1)
-
Breakthrough curves describe the concentration of the solution eluted from an adsorption column over time. The efficiency of a column is calculated from breakthrough curves as where Q is the...
-
For a bond issued at a premium, using the eff ective interest rate method, the: A . carrying amount increases each year. B . amortization of the premium increases each year. C . premium is evenly...
-
A company issues $30,000,000 face value of fi ve-year bonds dated January 1, 2015 when the market interest rate on bonds of comparable risk and terms is 5%. Th e bonds pay 4% interest annually on...
-
Lesp Industries issues fi ve-year bonds dated January 1, 2015 with a face value of \($2\),000, 000 and 3% coupon rate paid annually on December 31. Th e market interest rate on bonds of comparable...
Study smarter with the SolutionInn App