1- (A) In the editor, write the following function Function [A,B,C]-myfunc(x,Z) % [A,B,Cj=myfunc(x.Z) % Inputs: x is a constant, Z is an array % Outputs: A-x+Z, B-x*Z and C-Z-x A-x+2; B=x*Z; C=Z-x; Temp - A+B+C end • Save this file as the function name : myfunc.m. • What is the output when the following commands are typed in the MATLAB command window? > help myfune >A-rand(3,2); >> c=5; > [HI, H2, H3)-myfunc(c.A) > whos (B) In the editor, type these lines in and save as myscript.m. It looks very similar to the function in (A) clear cle A-rand(3,2); c=5; HI-c+A; H2=c*A; H3-A-c; temp-H1+H2+H3 • To run the script, in the command window type myscript, then you can type whos to see what the new variables are.
1- (A) In the editor, write the following function Function [A,B,C]-myfunc(x,Z) % [A,B,Cj=myfunc(x.Z) % Inputs: x is a constant, Z is an array % Outputs: A-x+Z, B-x*Z and C-Z-x A-x+2; B=x*Z; C=Z-x; Temp - A+B+C end • Save this file as the function name : myfunc.m. • What is the output when the following commands are typed in the MATLAB command window? > help myfune >A-rand(3,2); >> c=5; > [HI, H2, H3)-myfunc(c.A) > whos (B) In the editor, type these lines in and save as myscript.m. It looks very similar to the function in (A) clear cle A-rand(3,2); c=5; HI-c+A; H2=c*A; H3-A-c; temp-H1+H2+H3 • To run the script, in the command window type myscript, then you can type whos to see what the new variables are.
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter2: Problem Solving Using C++using
Section2.1: Introduction To C++
Problem 1E: (Practice) State whether the following are valid function names and if so, whether they’re mnemonic...
Related questions
Question
None
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr