GithubHelp home page GithubHelp logo

tassos / matlab_tutorial Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 1.0 267 KB

An interactive tutorial for teaching people how to use basic MATLAB functionality

MATLAB 100.00%
matlab teaching interactive tutorial

matlab_tutorial's Introduction

Interactive MATLAB tutorial

An interactive environment, working inside MATLAB, to teach basic concepts and syntax of MATLAB to students.

Prerequisites

MATLAB 2015 (haven't tested it with older versions, but it should work)

YAMLMatlab library

Project overview

This project aims to create an interactive environment that allows users to learn by trying different MATLAB commands. The idea is to make this extensible in order to allow the easy introduction of additional exercises.

The main problem with such an interactive environment is the way to verify whether the user input is correct or not. Therefore, the idea is to allow for different types of evaluation of the user input, depending on the type of exercise.

Furthermore, as this tutorial can be extended, it is sane to have a way to save progress for a user, so that (s)he does not have to repeat all the exercises every time it is executed.

Usage

In order to start the tutorial, simply run the function 'tutorial' in your MATLAB command line.

Preparing exercises

The main way to introduce new exercises, is by extending the 'tasks.yml' file. Each element of the yaml file corresponds to a new exercise, and the exercises are displayed in the order they are defined. The structure of each exercise is the following:

Question1:

  • background: Here comes the background that is displayed before the question
  • question: Here you can add the question
  • type: (string|commands) (more details on this later)
  • evaluation: [an array of correct answers, or commands to be evaluated]
  • preeval: [an array of commands to be executed before the evaluation]
  • posteval: [an array of commands to be executed after the evaluation]
  • courses: [an array of courses, for which the question is valid]

Background

What is inserted here will be displayed before the exercise, so that the student can learn something. You can insert pre-formated text (with multiple line breaks), by using the pipe character (|) on the first line and indenting all the rest

Question

This is the text that will appear as a question to the user

Type

This defines the way the answer will be evaluated. Currently there are two methods supported. String evaluation, and commands evaluation.

String evaluation

If the string evaluation is used for a specific exercise, the user input is compared against the strings contained in the 'evaluation' array. This is a string comparison, and if a hit is found, the evaluation is successful and the user input is considered correct

Commands evaluation

A series of commands are executed to verify that the user answered the question correctly. The commands are defined in the 'evaluation' array and are executed serially. Each command is expected to provide a '1' as an answer if it is successful or a '0' if it fails. If one of the commands fail, then the answer to the question is considered wrong.

Evaluation

An array which contains either strings of correct answers, or a series of commands to be executed and evaluate whether the user solved the problem correctly.

Preeval

An array of commands to be executed prior to the evaluation. This is useful in case some data structures or variables need to be prepared before evaluating the answer.

Posteval

An array of commands to be executed after the evaluation. This is useful in case some clean-up is required in order to avoid conflicts with future exercises.

Preparing the tasks database

The tutorial is reading the tasks from the 'tasks.mat' structure. However, since it is difficult to create it manually, the structure can be generated from the corresponding tasks.yml file. To do that, simply execute the generate_tasks.m script. Make sure you install the prerequisites of the project!

Contact

If you have questions or ideas, contact Tassos Natsakis.

Contributors

Many thanks to Zoltan Nagy for contributing with questions and feedback!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.