Programming-A-Starter-Project-Using-MATLAB-and-Python

버전 1.0.3 (3.99 MB) 작성자: Emma Smith Zbarsky
A scaffolded project involving pulling and installing a Live Task, then using MATLAB and Python to access and analyze data from a web API.

Programming: A Starter Project Using MATLAB with Python

View Programming-A-Starter-Project-Using-MATLAB-and-Python on File Exchange Open in MATLAB Online

Curriculum Module
Created with R2022a. Compatible with R2022a and later releases.

Description

This curriculum module contains interactive live scripts that teach fundamental concepts and basic terminology related to programming computers. This module explores interactions between systems by using the OpenWeather API and calling into Python from MATLAB. Programming: A Starter Project Using MATLAB with Python covers downloading and installing a Live Task to run Python code from a Git repository, accessing the OpenWeather API to check the weather, and choosing how to package the weather reports into your personalized weather display.

These lessons can be used as part of a lecture, as activities in an instructional setting, or as interactive assignments to be completed outside of class.

Get started with the Programming: A Starter Project Using MATLAB with Python interactive examples by downloading and unzipping the repository. Then, double-click the MATLABwithPython.prj file inside MATLAB®. From there, you can follow the landing page instructions to get started with the examples. The instructions inside the live scripts will guide you through the exercises and activities. Get started with each live script by running it one section at a time. To stop running the script or a section midway (for example, if a loop is running longer than intended), click the Stop button in the RUN section of the Live Editor tab in the MATLAB Toolstrip.

Prerequisite Domain Knowledge

This module assumes familiarity with basic programming concepts such as variables, data types, and functions, structures including arrays and structs, and control flows including if/else as well as how to use them in MATLAB. These ideas are all presented with interactive examples in Fundamentals of Programming, Programming: Organizing Data, Programming: Structuring Code.

Details

UsingMATLABwithPython.mlx Open in MATLAB Online

This script introduces the Run Python Code Live Task, as well as walking through checking that an appropriate version of Python is installed and visible to MATLAB.

Learning Goals: In this script, students will...

  • check that an appropriate version of Python is installed and visible within MATLAB.
  • download and install the Run Python Code Live Task.
  • try running Python commands and a Python script from MATLAB.

CheckingTheWeather.mlx Open in MATLAB Online

This script introduces the OpenWeather API, walking through setting up an account to get an API key, using an existing python script to access the API, and then investigation of the data that is returned.

Learning Goals: In this script, students will...

  • set up an account with OpenWeather to create your own API key.
  • use checkweather.py to make an API call to OpenWeather.
  • use MATLAB to explore the data returned by checkweather.py, including data type conversions, unit conversions, and data visualization options.

SampleWeatherDashboard.mlx Open in MATLAB Online

This script presents an example of a cleaned-up final product from following the directions in CheckingTheWeather.mlx. It uses a live script with Code Hidden to offer a pleasant user experience.

Learning Goals: In this script, students will

  • use hidden code interactions in live scripts to design a streamlined user experience.

Products

MATLAB®, Symbolic Math Toolbox™

License

The license for this module is available in the License.md file in this GitHub repository.

Support

Have any questions or feedback? Are you an instructor who would like solutions? Contact the MathWorks online teaching team.

Copyright 2022 The MathWorks, Inc.

인용 양식

Emma Smith Zbarsky (2022). Programming-A-Starter-Project-Using-MATLAB-and-Python (https://github.com/MathWorks-Teaching-Resources/Programming-A-Starter-Project-Using-MATLAB-and-Python/releases/tag/v1.0.3), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2022a
R2022a 이상 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
커뮤니티
 Distance Learning 커뮤니티의 더 많은 파일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

HelperFunctions

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.