7- There are important differences between values that are printed and output values. Consider the followin function definitions, and assume they are in three different M-files: function [] = f(x) disp(x); end function result g(x) result = 2*x; end function output h(x) result = 3*x; end • What is the output when the following commands are typed in the MATLAB command window? (a) >> f(1) (b) >> g(1) (c) >> h(1) (d) >> x = f(1) (e) >> x = g(1) (f) >> x = h(1) (g) >> disp(g(1)) (h) >> disp(h(1))

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section8.1: I/o File Stream Objects And Functions
Problem 3E
icon
Related questions
Question

7-
There are important differences between values that are printed and output values. Consider the following
function definitions, and assume they are in three different M-files:
function [] = f(x)
disp(x);
end
function result g(x)
result = 2*x;
end
function output h(x)
result = 3*x;
end
What is the output when the following commands are typed in the MATLAB command window?
(a) >> f(1)
(b) >> g(1)
(c) > h(1)
(d) >> x = f(1)
(e) >> x = g(1)
(f) >>x = h(1)
(g) >> disp(g(1))
(h) > disp(h(1))
Transcribed Image Text:7- There are important differences between values that are printed and output values. Consider the following function definitions, and assume they are in three different M-files: function [] = f(x) disp(x); end function result g(x) result = 2*x; end function output h(x) result = 3*x; end What is the output when the following commands are typed in the MATLAB command window? (a) >> f(1) (b) >> g(1) (c) > h(1) (d) >> x = f(1) (e) >> x = g(1) (f) >>x = h(1) (g) >> disp(g(1)) (h) > disp(h(1))
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Stack operations
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning