Coursera

matlab memo 001: plot & display a photo

Lesson 1 The MATLAB Environment clear clc plot x_coordinates = [1,3,10]; y_coordinates = [2,4.2,12.3]; plot(x_coordinates,y_coordinates); length(x_coordinates) %plot each point separately plot(x_coordinates,y_coordinates,'*'); %search docu…

python勉強メモ: file

open(filename,mode) mode(省略した時にrとして処理される) w:write r:read テキストファイルを実行しようとするコードと同じフォルダーに置く built-in functions \n :newline 改行 改行もstringの1として数えられる stuff="x\n y" print stuff x y len(s…

python勉強メモ: strings

string concatenation str1 = "hello" str2 = "mike" str3 =str1+str2 print str3 実行結果: hellomike +記号は文字列を繋げる。 raw_input()で取得したものは文字列になる。数字に変換するにはfloat()かint()を使う。 square brackets[]から文字列から一個…

coursera python

try and except you surround a dangerous section of code with try and except. if the code in the try works- the except is skipped if the code in the try fails- it jumps to the except section is Python has an “is” operator that can be used i…

python勉強メモ: Variables and Expressions

基礎の基礎の基礎 cd Desktopでデスクトップに行ける。 dirで所在位置のファイル一覧が見られる。 xyz.pyで直接プログラムを実行できる。 pythonの実行: c:\python27\python pythonからエグジット/を閉じる quit() データのタイプ:文字列or数値 string typ…