matlab代写-ECE 351
时间:2021-06-01
Lab0_handout January 9, 2019 1 Setting up Anaconda for ECE 351 1.1 ECE 351, Lab 0 1.1.1 Spring 2019 1.1.2 Purpose This lab goes through necessary steps for installing the needed (free) software on your personal laptop. 1.1.3 Overview For the lab this semester, students will be using Python 3.x on their own computers. (If you do not own a computer, discuss possible options with the TA. You may need to get Anaconda set up on a computer in the lab. John Jacksha (JJ) may also be an excellent person to speak with). There are a number of ways to set up Python, but one of the more straightforward methods (for the nature of work done in this lab) will be to download an Anaconda distribution of Python 3.x. Python and Anaconda, along with all included packages, are completely free. Included in an Anaconda distribution are the following: • Python 3.x • Jupyter Notebook (used for writing all code and lab reports) • Many useful packages for scientific computing that will be heavily used in this course – numpy, scipy, matplotlib... Not included in Anaconda distributions is the control package, which will be used in Lab 10 and Lab 12 (the final project). Instructions for installing this package are below. Instructions for using Jupyter Notebookwill be presented in Lab 1, so don’t worry about things being unfamiliar in this lab. 1 1.2 Anaconda Installation 1. To install an Anaconda distribution Python 3, go to the following link: https://www.anaconda.com/download/ 2. Select your operating system (i.e. Windows, macOS, or Linux). Download the Python 3.x version. This is a fairly large program, so you will need a few GB of free space on your hard drive. It will take some time. • If you have any questions about Anaconda or what is included in the download, there are some excellent resources at the bottom of the download page. Verifying Successful Installation Once Anaconda is installed, you should verify it was success- fully installed. Follow the steps below: 1. Open the Anaconda Navigator application/program 2. In it, open Jupyter Notebook 3. Once Jupyter opens in your default web browser, navigate to a good directory (folder) to save a file 4. In the top right corner, click the "New" drop-down menu, and select Python 3 5. In a code cell, type the following code and run the cell: import numpy import matplotlib.pyplot import scipy • Note there are multiple types of cells in Jupyter Notebook (this will be discussed in Lab 1). If you are uncertain whether you are using a code cell, click the "Cell" drop-down menu in the tool bar and go to "Cell Type" and select "Code." • To run a "Cell" simply click on the "Run" in the tool bar. 6. No errors should occur. If you do have errors, contact your TA or look up some Anaconda documentation for using conda to install the missing package 1.2.1 control Package Installation At this point we will install the control package for use in Labs 10 and 12. Note: On my computer (Windows 10 OS), the installation of the control package was fairly easy and straightforward. Please see instructions below for the installation. 1. Open the Anaconda Prompt 2. Install the control package using the command pip install control 3. It will bring up a list of Anaconda packages to upgrade/downgrade and install, requesting your confirmation • You may want to look over the list to check that no packages or programs outside of Anaconda are modified; I found no issues with the installation for my computer 2 4. Confirm, and the installation should commence and take some time to complete 5. The control package should now be installed. The following instructions help you install the control package on a MacOS system. Note: On a macOSMojave, v14.1 device, it upgrades/downgrades some programs within the Anaconda distribution during installation (for compatibility), which may prevent you from opening Jupyter Notebook. This can be fixed by updating all Anaconda packages after installing the control package, so be sure to not skip that subsection, below. 1. Open your command line utility (i.e. Terminal, Command Prompt, etc.) 2. Install the control package using conda install -c conda-forge control 3. It will bring up a list of Anaconda packages to upgrade/downgrade and install, requesting your confirmation • You may want to look over the list to check that no packages or programs outside of Anaconda are modified; 4. Confirm, and the installation should commence and take some time to complete 5. The control package should now be installed; If the Jupyter is not working at this point, move on to the next step to get it running again Now, you must update all packages in Anaconda (it will not update any packages that will be incompatible with the packages you have installed, including the control package). To do this, run the following line of code in your command line utility: conda update --all. After this completes, your Anaconda environment should be up and running, along with the control package. Additionally, you will need to update (or downgrade, really) the pandas package using conda install pandas because the Anaconda distribution will come with pandas for Python 3.7, but control uses Python 3.6, so you need to downgrade pandas to the version for Python 3.6. Verifying Successful Installation To verify, do the following: 1. Open the Anaconda Navigator application/program 2. In it, open Jupyter Notebook 3. In a code cell, type the following code and run the cell: import numpy import matplotlib.pyplot import scipy import control import pandas 4. No errors should occur. If you do have errors, contact your TA or look up some Anaconda documentation for using conda to install any missing packages • Worst case-scenario, you may need to uninstall the entire Anaconda environment and start over. For most issues, there are a number of StackExchange threads with some in- formation. At any rate, it is always a good idea to notify the TA if the above instructions are not working. As time progresses, aspects of these instructions (written in January 2019) may become obsolete and need to be updated. 3





































































































学霸联盟


essay、essay代写