Skip to content

Instantly share code, notes, and snippets.

@gioAlea
Last active August 29, 2015 14:23
Show Gist options
  • Save gioAlea/c611f71f99ec1512b20d to your computer and use it in GitHub Desktop.
Save gioAlea/c611f71f99ec1512b20d to your computer and use it in GitHub Desktop.
matlab cheatsheet

logical values: 1 (true) ; 0(false)

logical indexing: v(v logical function) restituisce i valore che soddisfano la logical function

get help: doc funcName

close all figures: close all

Print to screen: disp 'whatever'

Row array: x = start:step:end

Traspose array: x'

Print multiple variables on 1 line: fprintf('%s will be %d this year.\n',name,age); or X = [name,' will be ',num2str(age),' this year.']

Extract matrix columns from column start to end: A=rand(5,5); A(:,start:end)

Rows and column sizes: [rows,columns]=size(A)

Max value and index of max: [maxValue,maxIndex]=max(v)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment