Question: Matlab code Function Name: asciiGarden I nputs: 1. (char) A filename of an Excel file containing garden information, including file extension Outputs: None File Outputs:
Matlab code
Function Name: asciiGarden
Inputs:
1. (char) A filename of an Excel file containing garden information, including file extension
Outputs:
None
File Outputs:
1. A text file representation of your new garden
Background:
Spring has finally arrived, and you can't wait to finally realize your dream of planting a beautiful garden to provide you with a supply of fresh fruits and veggies. You decide to use your favorite tool, MATLAB, to help you plan the layout of your new garden!
Function Description:
Write a function that reads in an Excel file describing the layout of your garden, and creates an ASCII art representation of your new garden as a text file, named as follows: ascii_
Each column of the Excel file will contain the following information in this order:
The names of the fruits and vegetables to be planted in the garden
The character representation corresponds to each plant
The number of rows of the garden that should contain the fruit or vegetable
Example:
>> asciiGarden('garden1.xlsx') should write the following text file to your current directory:
garden1.xlsx:
| Tomatoes | O | 1 |
| Pumpkins | ~Q | 2 |
| Carrots | V | 3 |
| Peas | oo | 1 |
ascii_garden1.txt:
OOOOOOOOOOOOOO ~Q~Q~Q~Q~Q~Q~Q ~Q~Q~Q~Q~Q~Q~Q VVVVVVVVVVVVVV VVVVVVVVVVVVVV VVVVVVVVVVVVVV oooooooooooooo
Notes:
Your garden plot should have twice as many columns as rows.
All test cases are guaranteed to have full vegetables planted; for instance, if a vegetable
is three characters long, the number of columns will be divisible by three.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
