AaltoSciComp
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Matlab basics 2020 ###### tags: `Matlab_Basics` *We use hackmd which is like a google doc, but more useful to share simple text (like code). ...Also because Zoom chat is useless for anything productive. ◕‿◕* *Click on the pencil above to start editing this document. Ask questions or write comments always at the very bottom of the document. Click on the eye icon when you do not need to edit.* ## Some useful infos 1) **zoom link for the sessions** https://aalto.zoom.us/j/62815248114 _the sessions will be recorded and published on YouTube, so by default your microphones will be muted. If you wish to talk, raise your hand using zoom controls so that I can unmute you. Remember it will be recorded and published._ 2) Make sure **your zoom name is the same that you used to register** for the course. 3) There are **4 sessions**. See details [here](https://version.aalto.fi/gitlab/eglerean/matlabcourse/-/tree/master/AY20202021/MatlabBasics2020#matlab-basics-2020-ay-2020-2021). 4) We need to **move the session of 18/11 to a different day**. Please pick your preferred option by visiting this link -> https://presemo.aalto.fi/matlab 5) **To do before the workshop** - Every participant will **code during the workshops**, so make sure you have a working copy of Matlab on your personal computer. - Make sure you also have an **active account on https://www.mathworks.com/** by using your Aalto email (or your institution email) as this will unlock educational features on Matlab's website. - Make sure you **download the data** that we will use during the course by following the instructions at https://swcarpentry.github.io/matlab-novice-inflammation/setup.html 6) for those who need the **credit or certificate**, see detailed info [here](https://version.aalto.fi/gitlab/eglerean/matlabcourse/-/tree/master/AY20202021/MatlabBasics2020#matlab-basics-2020-ay-2020-2021). # IceBreaker: your learning goals ### Write down what you expect/wish to learn from this course. - To understand in what situations is better / more convenient to use Matlab than Python - To learn to do some graphics with Matlab and to handle large data sets - To pick up how to learn Matlab on one's own; I feel a threshold in just trying to understand what people are writing about on Stack Exchange - Edit: Okay, I feel silly now, seeing the wealth of available resources. I was reflecting on my bad start with Python last month, which was more my own fault. - To learn how to plot data - to learn how to use existing code for data analysis and visualize data - To be able to take advantage of this in my course exercises - Learn to read the basic syntax / code others wrote - To learn how to build a simple DNN like VGG-8 or LeNET-5 to interface with other EDA software like Cadence for NPU development and optimization - My (graduate and undergraduate) students are fluent with Matlab. I want to know the basics of it so that I can guide them and know, what I can expect of them. - Learn the basics of Matlab - Use Matlab libraries - Extrapolation and interpolation of data - To learn basics - To be able to make nice figures (also in color) - To learn how to visualize data in 2D and 3D. - To learn the basics to edit and modify codes that others wrote. # Questions and comments - When is a section useful? - The main usefulness of comments (%) and sections (%%) is for the reader. I advise to always write comments first and then the actual code that should come after. Sections have an extra advantage because you can tell matlab to execute only a specific section of a long script. This can be useful, but it can also be tricky (e.g. sections can be manually executed in different order than written in the script and that can lead to unwanted behaviour). - . - Is it possible to get both the credit for this course and the certificate? - Sure! But for the credit you need to be an Aalto student with an Aalto student ID (I have no power to give credits to FiTech or Helsinki.fi). You can however "transform" the certificate into a credit with your organisation. - - I am unable to use backspace, is it a normal feature or do I have something wrong here. Yes it works fine here. On Matlab it takes me to the end of the ''code''. - I assume it's backspace in the Matlab command window, right? E.g. backspace would work here if you want to delete something. Ok I can mention about these options. - I could ue the readmatrix command. I guess you might have not loaded the "module" that contains this function (I'm not sure that it is a function). I'm using the last version of MatLab - Good! I am not sure why my matlab doesnt find it. Ok, it was introduced in R2019a, I am running R2017a. This is a good thing to mention in general, thanks. - How can I "flip" y-axis, if I want low values on bottom? - axis xy - How do I paste multiple lines of code? - check shortcuts of operating sys - When are you uploading the video? It would be nice to have it in case we need some help with the exercises. - latest in 10 days - How can I change the sign of only one colum in the matrix? - with dot product and a matrix of ones and ""-1s" Highly recommended: https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005510 ## Feedback about day 1 *Write something positive and something that could be improved about today's session* Thanks for the course! The speed is very good, so the clarifications are possible and complete! I know it is too early at this moment, but maybe at the end would be possible to make a session with data simulations - i.e. simulate data to study some phenomena, or process... Good: started from very basics. Went in some places perhaps a bit fast, if one wanted to code at the same time. Good session. Easy to follow It was a great sessiion Can we have something similar for Python especailly a learning space like the Matlab onramp It was easy to follow, which was very good! I don't have anything that should be improved. Looking forward to the next session :-) Very nice. Especialle the anonymous question platform is good, it is easy to ask them this way. Pace was good, even for me who has no earlier experience from programming. The pace was good and created a good working flow. Very well organised. No suggestions for changes now. :) # Icebreaker day 2 *Do you know or can you google a Matlab toolbox NOT developed by matlab that is/could be useful for your work? Can you paste a link to it?* - SPM, useful to analyse fMRI brain data https://www.fil.ion.ucl.ac.uk/spm/ - Molecular dynamics simulations http://moleculargeo.chem.umu.se/codes/atom-scripts/ - LeNet-5: https://github.com/KiveeDong/LeNet5-Matlab - T2N - Matlab interface for NEURON, which is for simulating neuronal electrophysiology https://www.treestoolbox.org/T2N.html - fieldtrip, for brain time series collected with MEG and EEG https://www.fieldtriptoolbox.org/ - Toolbox for optics: https://optilux.sourceforge.io/ - Aspen Plus Dynamics https://se.mathworks.com/products/connections/product_detail/aspen-dynamics.html?s_tid=srchtitle CAT - Computational Neuroanatomy toolbox for SPM (Matlab-based) - http://www.neuro.uni-jena.de/cat/ # Questions and comments - Matlab operators https://se.mathworks.com/help/matlab/matlab_prog/matlab-operators-and-special-characters.html - Undefined function or variable 'readmatrix'. `Error in plot_patient1 (line 1) patient_data = readmatrix('inflammation-01.csv'); ` - I discovered the same yesterday, it relates to your version of MATLAB. I also have a version older than R2019a, so you you need to use another function like "load" - Enrico, the audio continues cutting off. Could you do something about it? Perhaps the place you are now (livingroom, dinningroom, ...)? - I have the same connection as yesterday, I use mobile internet so there might be something today with the Telia network. :( The signal strength is high, so I think the bottleneck is somewhere else in the internet. - Could you tell us more about the command window and the editor and their differences? Pretty clear that editor is for saving scripts and command window is for playing around, but what more is there to consider? - We can check this at the end if there's time - Please slow down. The connecting is loosing, very hard to follow - ok I will - Not sure why but for me it shows: >> files = dir('data/inflammation-*.csv') files = 0×1 empty struct array with fields: name folder date bytes isdir datenum - this means that you might not have the `data` subfolder under your location where you are right now. If you do "ls" you should be able to see if you have "data". Otherwise you need to "cd" to the parent folder of "data". E.g. in my case this is: '/Users/enrico/code/matlabcourse/AY20202021/MatlabBasics2020/SCMatlab/' - so I would need to "cd /Users/enrico/code/matlabcourse/AY20202021/MatlabBasics2020/SCMatlab/" - and then from there type "ls" - and see that I have "data" as output - **Got it, thanks! I had the .csv files contained in the same folder as the plot_all.m** - The coding parts feel a bit rushed/fast and it is hard to keep up, especially if one makes a typo or some other error while writing the script - Thanks for the feedback, I will try to go a bit slower - The plot_all command worked, but there is a strange warning at the end of the output: Warning: Direct access of structure fields returned by a function call (e.g., call to plot_all) is not allowed. What does this warning mean? - We can check it at the end - Can you maybe come back to this question please? - Where to check all possible file formats for saving the figures or images? - you can check them with the documentation of the "print" command - https://se.mathworks.com/help/matlab/ref/print.html?s_tid=srchtitle - - why do we need the "==" sign? - https://se.mathworks.com/help/matlab/matlab_prog/matlab-operators-and-special-characters.html # Feedback for today *Forgot to ask for feedback for today... could you still type it here below if you were attending the second session? Write something good about, and something that could be improved.* - feedback here - write here - or here - . - . - . - . ---- # Day 3 - Matlab Basics ## Icebreaker - Revise your learning goals + wishes for last lecture *Now that you are a bit more familiar with Matlab, what would you like to hear in the last lecture next Thursday? Topics span between: input (data loading, working with big data), processing (computing tips, parallel computing), output (saving processed data, making advanced figures)* - To introduce the most useful "advanced" functionality of MatLab according to your experience - I would like to hear/see more about making figures (e.g. 3D, colorful figures etc) - To see how to hanlge large dataset. - To see if it is possible to do interactive pictures with Matlab. That is a 3-d image you can turn around and zoom in - Would the beginnings of signal processing be possible to cover? - Best practice/conventions for handling large data (input/output) - Maybe also go through procedure to solve physics related problems with matlab. - etc - .signal processing would be useful for me - - Any tips about using version control with matlab. I was at the code refinery too and would like to know where from to use git commands. - . - .Could you also show one point how to load text data and making plot from text data ## Icebreaker 2: would you be interested in taking Matlab advanced course in 2021? January? Feb? March? April? - Yes, January... - Yes, any month. - Yes, Preferably Feb-March (second hald of January too) - Yes. Either Feb or March - Yes, any month. I would also like to learn about SPM, if this would be possible - Yes in February or March too. - yes, in Januaray - yes, maybe not janyary, any other if good - Yes, March will be more preferable(Might work with Jan). - Very much interested.Jan would be nice - Yes, February is preferable - Yes, Jan is preferable # Questions here below - Is it really the best practice to have one function per file. Or would it make sense to have in some situations more than one fucntion in a single file? - It depends :) Sometimes you have a main function that then needs to call multiple subfunctions, in that case they can all be in the same file. The subfunctions however will be kind of "invisible" from your command window. But in general yes, we have one function per file and often they are grouped into the same subfolder to form a toolbox. - I got totally lost in the back and forth when creating the plot_dataset function, sorry. I couldn't follow what I should have copied and what I needed to add. **I can check everything with the exercise solution** - When will the video be online? My colleague could not make it today. - Would it be possible to have an example of inspecting a novel data set - e.g. a stack of MRI scans, or a data from some other scanner (e.g. EEG data)? It would be great to learn basics on how to inspect, open and handle a data set that we are not familiar with. - You have to allow others' microphones on Zoom. - . ## Feedback for the day *Write something good and something that could be improved about today's lecture* - The course progression is a great learning process on how pedant and tidy should be your code "bookeeping". Today I spent some time searching scripts and parts of the code from the last week - I dont even want to think if I was searching for some scripts from last year! The general couse progression is very good, building the understanding gradually, based on previously acquired knowledge. Videos are going to be very useful. - The progression and reasoning was very clear so I think the video will be very good. Unfortunately, I kept falling behind and losing track today, even though I was perfectly on track the last two training lectures. - I liked that we had time to try the exercises by ourselves. However, the whole lecture was a little fast today and, thus, a little harder to follow than the last two lectures - Good course. I learn lot about Matlab. I was able to follow exercises. When I was lost I copied the answer from SW Carpentery web site. # Day 4 ## Icebreaker **how are you feeling today? Did you have time to try Matlab Onramp from https://matlabacademy.mathworks.com/?** - Yes. The exercises take longer than what I tought. Tough good practice. - Feeling good today :-) I finished onramp and started with matlab fundamentals (I stopped before the 3D figures) - another one - Feelin okay and I am still on Matlab Onramp. At the moment am at 61%. - Feeling a bit tired but ready for today. Had a chance to start Matlab Onramp. - Same here, but didn't have time to try Onramp - Onramp 61% completed. feeling busy but OK. - . ## Questions or comments - - . - **Code for today at https://version.aalto.fi/gitlab/eglerean/matlabcourse/-/tree/master/AY20202021%2FMatlabBasics2020%2Fsrc** ## Feedback about today and about the whole course *Write something positive and something that could be improved* - A good compact course that dives to the basics of Matlab. - Today you had a very smooth connection! Very good compact introduction to Matlab. It felt really nice being guided through the material step by step. I feel much more positive about learning more Matlab. Thank you very much for your work. - Good Matlab tutorial. Thanks for your work. - Overall: the course was very good structured and easy to follow. Thanks a lot! - Excellent structure that covered everything from very basics to basics of advanced Matlab coding. Maybe in the future you could organise courses for specific groups, like biologists, neuroscientists etc. Other take would be to focus on specific type of analysis, such as image recognition, machine learning etc. - Very detailed course and helpful. - This course is useful even for peolpe who master Matlab, as the teacher explains some concepts that are useful in genaral. - I like how the teacher is flexible and cares most about learning and technical course outcome. - It is a very useful course and it has been an interesting one, Touches mostly everything one needs to know for a basic course. - Today's explanation about data plotting was nice. - Good communication between the instructor and the audience. --- *Always write above this line. We go through questions and comments*

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully