資料輸入 MATLAB 資料輸入與輸出 請先下載本週上課資料. 本週內容 File I/O. 資料輸入 (file input) The first step for data analysis. 資料輸出 (file output) The last step for data analysis

Similar documents
National Sun Yat-Sen University Thesis/Dissertation Format Regulations

Luminance-Current-Voltage Measurement System (LIV)

National Sun Yat-sen University Thesis/Dissertation Format Regulations

MTV3200(S/D)/MTV3700D Firmware Release Notes. by Pixel Magic Systems

MTV7000D/7000D-Mini Firmware Release Notes. by Pixel Magic Systems

HONR400 Honours Project Guidelines Governing the Format of Abstract, Poster & Honours Thesis

臺北市立弘道國民中學 106 學年度第 2 學期 8 年級英語科第 1 次定期評量

林尚亭 1 張誌軒 2 國 立 高 雄 師 範 大 學 高雄師大學報 2007,22,63-70 SRTS 方法在高速傳輸系統的應用

立人高級中學 104 學年度第 2 學期國一英語科第二次段考試題範圍 : 康軒第二冊 Unit 4~Unit 6 年班座號 : 姓名 :

103 年高中高職特色招生考試英語科參考題本

台北縣立江翠國中九十七學年度第一學期八年級第一次段考英語科 ( 共 4 頁 )

Notice to Graduands. The 31st Graduation Ceremony. 3:00pm - Thursday 22 June Lyric Theatre

西北工业大学现代远程教育 专科入学测试英语复习大纲 ( 第八版 )

高雄市立右昌國民中學 106 學年度第 1 學期第一次段考三年級英科試題三年 班座號 : 姓名 : A. 聽力測驗一 辨識句意 : 每題均有三張圖片, 請依據所聽到的句子, 選出符合描述的圖片.( 每題 1 分,5%) (A) (B) (C) 2. (A) (B) (C) 3.

期刊篩選報告建議 Journal Selection Report

(1) LCD TV. Operating Instructions GB 操作手冊 KDL-55W950A / 46W950A

Autobiographies 自传. A Popular Read in the UK 英国流行读物. Read the text below and do the activity that follows. 阅读下面的短文, 然后完成练习 :

I can t remember what I dreamt of last night. ( 私は昨晩夢で見たことを覚えていません )

CABLE SNIFFER-REMOTE MT-7057

2018 年度学力試験問題 芦屋大学 一般入試 (C 日程 ) 2018 年 3 月 16 日 ( 金 ) 実施 志望学部 学科学部学科 フリガナ 受験番号 氏名

(2) 批判實在論發展中具有重要意義 特別是提出核心概念的重要文獻 ;(3) 概念批判與發展 : 以批判實在論觀點批判 重建特定社會學概念 ;(4) 批判實在論與研究方法 : 特別是如何嫁接到質性研究方法 ;(5) 應用批判實在論的經驗研究案例 ;(6) 批判實在論的評價 課程目標 :

Free Elective (FE) Courses offered by Arts Departments

What s New. January, Faculty Advisors 潘怡靜主任陳美貞老師謝春美老師

國立中興大學圖書資訊學研究所 (National Chung Hsing University, Graduate Institute of Library and Information Science) 授課語言 (language)

服務行銷專題研討. 服務業行銷 Journal of Service Research 13(1) 4 36

Building TOEIC Reading Skills

第七十二期. Time Magazine s Person of the Year: Some Criticisms 時代雜誌的年度風雲人物 : 一些批評與評價

Dear Principal and Teachers,

Biography Of Entrepreneurs Pdf Download >>>

臺北縣立江翠國民中學九十八學年度第二學期第二次定期考查八年級英語科 P.1

User Guide. Smart Open-Closed Sensor REV1.0.0

How to use the resources in this course to learn Chinese How to use the resources in this course to teach Chinese 练习本教师使用指南練習本教師使用指南

如何撰寫高品質之期刊論文 李孟智教授中山醫學大學醫學研究所. 研究者歷經產生問題 假說之形成 申請研究計畫 執行研究 資料處理與分析之外 最重要的就是將論文發表 (Publication) 於期刊雜誌, 除了可與同儕切磋分享及個人和單位之得分外, 並可轉化為實務應用, 達成研究三贏之最高效益

Title: Harry Potter and the Half-Blood Prince

Updates on Programmes for January February 2014

DCS-8525LH. Full HD Pan & Tilt Wi-Fi Camera. User s Manual

Video Decoder Introduction. by Connor

Free Elective (FE) Courses offered by Arts Departments

Quick Start Guide. 28-Port and 52-Port L2 Gigabit Ethernet Switches ECS4120 Series. 1. Unpack the Switch and Check Contents

CABLE SNIFFER-REMOTE MT-7057N. User s Manual 1 st Edition, Copy Right by Prokit s Industries Co., Ltd.

第 112 期. What s the point of a leap year? 閏年存在的意義?

106 年 挑戰學習力 : 認識陸興學藝競賽英文科試題

英検 2 級合格者のスピーキング力の現状と問題点

M+ 敢探號 : 教材套. M+ RoveR: a TeacHeR s ResouRce PacK. Tang KwoK Hin

Television HOME. Help Guide KDL-32W660F. Operating Instructions GB 使用說明書 (1)

個人履歷 (CURRICULUM VITA)

1 0 4 年認識陸興活動學藝競賽 A: 綜合選擇題 : 共 50 題, 每題 2 分, 共計 100 分

Behavioral Contract. ====================={Student Section}=====================

USB Microphones Inadequate Shielding Functional Test 麦克风屏蔽不良功能测试

3 級リスニングテスト 原稿. I m hungry, Annie. Me, too. Let s make something. How about pancakes? 1 On the weekend. 2 For my friends. 3 That s a good idea.

1. It s so easy to forget the simple things in life, like what it feels like to swing on a swing, or to watch leaves blowing in the wind.

3 級リスニングテスト 原稿. I m hungry, Annie. Me, too. Let s make something. How about pancakes? 1 On the weekend. 2 For my friends. 3 That s a good idea.

國立中興大學教學大綱. (Eng.) Study of Technical Services

User Guide. Kasa Cam REV1.0.1

Online Knowledge Bases and Cultural Technology: Analyzing Production Networks in Korean Popular Music

User Guide. Kasa Spot REV2.0.0

2014 年复旦大学本科外国留学生入学考试大纲

复旦大学 2018 年本科外国留学生入学考试大纲

Curriculum Vitae 任教領域 認知與學習 學習神經科學 幽默與學習 認知心理實驗設計 普通心理學

01 常用单词 听写 Words Dictation

Po Leung Kuk Ngan Po Ling College Final Examination Coverage ( 考試範圍 )

MANKS. Oval Plate (36cm) HKD 1,860 Pitcher HKD 1,325 Oval Plate (22x25cm) HKD 625 LTD

Important Information

Listening Part I & II A man is writing some figures on the board. 數字

從 哈哈 到 啊哈 統整知 情 意 行的幽默課程對創造力培養的影響

User s Manual LB1XX/KB1XX Series. Smart Wi-Fi LED Bulbs REV 2.0.1

Burst-Packet-Loss Concealment for MPEG-2 Video

1. 疑問文 1 3. 助動詞 3 4. 受動態 4 5. 不定詞 5 7. 動名詞 関係詞 接続詞 比較 代名詞 形容詞 副詞 前置詞 仮定法

國立交通大學 電子工程學系電子研究所碩士班 應用於低溫多晶矽製程下和差類比數位轉換器電路設計與實現. Design and Realization of Delta-Sigma A/D Converter in LTPS Technology

Lesson 27: Asking Questions/Clarifications (20-25 minutes)

Om Jai Ambe Gauri Pdf Download ->->->->

To the Student. Japan Goes Global! Thinking critically about Japanese popular culture

Miguel & TAs (Amy & Evan)

User s Manual HS200. Smart Wi-Fi Light Switch REV 2.0.0

(Cable, Adapter, Connector provider) Type Connector(R) Code

User s Manual HS200. Smart Wi-Fi Light Switch REV 2.0.1

高雄市立正興國中 104 學年度第 2 學期第 2 次定期教學評量二年級英語科試題

Students are expected to take 2 core courses in the 1st term and 1 core & 1 elective course in the 2nd term.

The Internet community is getting bigger and bigger. ( インターネット コミュニティはどんどん拡大しています )

国家开放大学 ( 中央广播电视大学 )2015 年秋季学期 " 开放专科 " 期末考试 英语昕力 (3 ) 注意事项 一 将你的学号 姓名及分校 ( 工作站 ) 名称填写在答题纸的规定栏 内 考试结束后, 把试卷和答题纸放在桌上 试卷和答题纸均不得带

まであり 13ページにわたって印刷してあります 解答しなさい 答えはア イ ウ のうちから最も適切なものを選び 解答用紙 にその記号を書きなさい

X52 PROFESSIONAL HOTAS USER GUIDE / 用户指南

文化学園大学杉並中学校英語特別入試リスニング問題スクリプト

User Guide. Wi-Fi Smart Plug HS100 Wi-Fi Smart Plug with Energy Monitoring HS110 REV

謝文揚簡歷 論文及其他著作目錄 現職 : 聖約翰科技大學電子工程系教授 Senior Member, IEEE 行政院國家科學委員會獎助特殊優秀教師 ( )

At the beginning the artist requested a room, but in the end, there was some compromise.

2018 北京市石景山区高三 ( 上 ) 期末 英语

Briefing Session on 2012 HKDSE Visual Arts Examination Papers 20 & 21 Sept 2012

臺北市立南門國中 100 學年度第二學期九年級英語科第二次定期評量試題卷

Specification. FireFly. 1/3" CMOS Sensor 1200 TVL. NTSC / PAL optional. 16:9 / 4:3 optional. Internal. >52dB (AGC OFF) CVBS. 2.1mm.

Television. Reference Guide KDL-70W850B / 60W850B

The Arts House is managed by Arts House Ltd. twenty fifteen september

第 15 课生日晚会 (Lesson 15 Birthday Party)

參考字彙表 來源 : 教育部 本表為常用 2000 字詞, 其中畫底線者為國民中小學最基本之 1200 個字詞

1.10 回以上出題 1 解答 解説 25

MUSIC A Language Without Borders

I registered myself for the business convention. ( 私は自分でビジネス コンベンションに申し込んだ ) I bought myself a briefcase. ( 私は自分にブリーフケースを買った )

Klystron Output Resonator - Particle-in-Cell (PIC) Simulation

Transcription:

請先下載本週上課資料 http://www.ym.edu.tw/~cflu 點選左欄 [ 課程資料 ] [MATLAB 圖形使用者介面 ] 下載第 7 週 [ 上課資料 ]materials_l7.zip, 檔案大小約 15MB MATLAB 資料輸入與輸出 盧家鋒助理教授 alvin4016@ym.edu.tw 1 請先將 Current Directory 切換至 materials_l7 資料夾! 2 本週內容 File I/O 資料輸入 (file input) The first step for data analysis 資料輸出 (file output) The last step for data analysis Input/Output the following file formats *.mat, *.txt, *.csv, 2013 3 資料輸入 4

Types of Raw Data ASCII text (*.txt, ) Excel files (*csv, *.xls, *xlsx) Binary format Medical image & signals (DICOM, MFER ) Vender-defined formats (*.*) 5 Before File I/O Data Information Sampling rate in Hz Data length time frames or data points Dynamic ranges maximal and minimal values Physical units absolute or relative values, arbitrary unit Events, Annotations, Markers onset time 6 Values are stored as a "Matrix" Values are separated by, or ; or Space or Tab Drag-and-drop file into MATALB workspace Use "Notepad" to check if the file is. the data is stored as a matrix. 7 8

Values are stored as a "Matrix" Values are separated by, or ; or Space or Tab load(fullpath); load('.\ascii\data.wl1') load('.\ascii\marker.evt') 9 Define File Path Method 1: Include file extension!! Key in absolute file path fullpath='c:\users\alvin\dropbox\10301matlab 圖形使用者介面應用於生醫訊號分析 \Lesson7_ 資料輸入與輸出 \materials_l7\ascii\data.wl1'; fullpath=[pwd '\ASCII\data.wl1']; fullpath='.\ascii\data.wl1'; Method 2: Key in relative file path fullpath='motiondata.mat'; Method 3: Use uigetfile [filename filepath]=uigetfile('*.*'); fullpath=[filepath filename]; 10 Values are NOT stored as a "Matrix" Drag-and-drop file into MATALB workspace Use "Notepad" to check 11 12

Values are NOT stored as a "Matrix" Cannot use load to import data data=importdata(fullpath); data=importdata('.\ascii_mix\data.dat'); data=importdata('.\ascii_mix\config.txt'); http://www.ym.edu.tw/~cflu Input using fopen, fseek, fread, and fclose http://youtu.be/nmfgo4embpa 10/30/2014 Lesson 7, Chia Feng Lu 13 Excel or CSV Comma-Separated Values (*.csv) Excel files (*.xls or *.xlsx) Save data in various sheets Use "Excel" to specify location Rows and Columns Sheet sheet 2, from D4 to F226 14 Excel or CSV Excel files (*.xls or *.xlsx) allow data to be saved in various sheets Use xlsread to load an Excel file [NUMERIC,TXT,RAW]=xlsread(fullpath,2); data=xlsread(fullpath,2, D4:F266'); data=xlsread(fullpath,' 工作表 2','D4:F266'); The Empty block will be assigned as a NaN. 15 Binary format Prior information of Data precision is required fid=fopen(full_filepath,'r'); data=fread(fid,inf,'float32'); data=reshape(data,channelno,[])'; fclose(fid); http://youtu.be/nmfgo4embpa 16

Useful Functions - File Input uigetfile % 呼叫開啟檔案對話視窗選取檔案路徑 load % 讀取 ASCII 或 *.mat 檔案 ( MATLAB 專用檔案格式 ) importdata % 使用自動輸入檔案功能 fopen % 指派檔案 ID( 以正整數代表 ) 給所選路徑檔案 fread % 以特定 precision 讀取 binary 格式檔案 fscanf % 讀取 ASCII 檔案內容 fseek % 移動檔案游標位置 fclose % 釋放檔案 ID 與所選路徑檔案 xlsread % 讀取 *.xls 或 *.csv 等試算表或分隔符號檔案 17 資料輸出 18 Common Output Formats MATLAB data files (*.mat) Excel files (*.xls, *xlsx) Print Image files (*.jpf, *.tiff, *.bmp, *.pdf) ASCII text files (*.txt) http://youtu.be/djgk1x9psxo Self-defined binary formats (*.*) 19 MATLAB Data Format Use save to create a *.mat file save(filename) save(filename,variable1, variable2, ) save(filename,variable1, variable2,,format) The file created by save can be directly read by using load. 20

Excel Files Use xlswrite to create an Excel file Save a number array xlswrite(fullpath,data,2,'b10'); Save a cell array xlswrite(fullpath,datacell,3,'a2'); 21 Print Image Files Use Print to save the image within a figure JPEG '-djpeg' BMP '-dbitmap' TIFF '-dtiff' PNG '-dpng' PS (PDF) '-dpsc2' 22 File output 常用函式列表 uiputfile % 呼叫儲存檔案對話視窗選取檔案路徑 save % 儲存 ASCII 或 *.mat 檔案 ( MATLAB 專用檔案格式 ) xlswrite % 覆寫 *.xls 或 *.csv 等試算表或分隔符號檔案 fopen % 指派檔案 ID( 以正整數代表 ) 給所選路徑檔案 fseek % 移動檔案游標位置 fwrite % 以特定 precision 覆寫 binary 格式檔案 fprintf % 覆寫 ASCII 檔案內容 fclose % 釋放檔案 ID 與所選路徑檔案 23 THE END alvin4016@ym.edu.tw 24