Matlab Flashcards
When can the && and || be used. What’s the difference between their functions on scalar and array.
the && and || cannot be used for arrays. For scalars, using the double instead of the single makes it so if one condition is met, the code is short-circuited.
Define Cell arrays. What makes them different form the normal kind of arrays and how do you calculate them. And how do you index them.
Cell arrays can stack different kinds of data type in them. Etc, string and double integers can be put together. You use curly bracktets { } to create cell arrays. Using standard brackets will return the cell itself. But if you use { } the contents of the array will be returned.
What’s the difference between break and continue in loops.
The Break function jumps out of the entire loop when a condition is met. The continue function jumps back to the start of the loop.
Why use UDF ? And what’s the long form of that bro?
UDF - User defined Functions are used for better readability, portability and and reliability.
What is the purpose of and the difference between local and global variables?
When using UDF, a locak variable will be created within the function but will not appear on the workspace, but If you want to use the variables that are created within these UDF, you will need to declare them global by typing them both in the UDF and the main window.
What is ezplot? what is it’s function ? What can you use the hold function as ?
ezplot is the symbolic equivalent of the plot function. As such, there are also functions such as ezsurf, ezmesh etc. They will always plot within the range -2pi and 2pi if no range is specified. To plot more than one plot, you can use hold.
What is simulink and what is it used for ?
Simulink allows users to create a mathematical model and run it for a specific length of time. It can deal well with systems that can be modelled as
differential equations, solving them numerically.
• It is used extensively in research and industry as it can
integrate into hardware to perform hardware-in-the-loop testing.
What is the difference between clear and clc.
Clc clears the command window. Clear clears away all the variables in the workspace.