Matlab - functions Flashcards

1
Q

what is a function

A
  • Functions take inputs and return outputs.
  • everything that happens
    within a function is hidden or encapsulated from the main workspace
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what does a global variable mean when writing a function?

A

this variable will not be hidden and will share the same values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

how do you write a function?

A
  • the same way as a script
  • it must begin with the word function
  • function [outputs] = function_name (inputs)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

why is a path important with functions?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly