Problem 61151. Scaling vertically functions
Given a real function by the 1×n array, x, of inputs and the 1×n array, y, of outputs, consider shifting vertically its graph by the scale factor k (see figure below). Return
- y_scaled, which is the 1×n vector that stands for the outputs of the scaled function;
- s = 'strech' or 'compress', if the graph will be away from or towards the x-axis, respectively, becoming narrower or wider relative to the original function's graph. Return s = '', if there is no change in size;
- r = 'flip' or 'flat' if the graph will be reflected over the x-axis or collapses the entire graph onto the x-axis, respectively. Return r = '', if the orientation is preserved.
input: (x, y, k)
output: [y_scaled, s, r]
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers2
Suggested Problems
-
2 Solvers
More from this Author14
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!