Free Essay

Pelajaran Matlab

In:

Submitted By almijwad
Words 819
Pages 4
SUPLEMEN
Pemodelan Sistem / Pengolahan Sinyal /
Metode Kuantitatif

TUTORIAL SINGKAT
MATLAB

oleh:
Judi Prajetno Sugiono

Sekolah Tinggi Teknik Surabaya
(2005, 2008, 2011)

judi@stts.edu ©2005

p. 1 of 40

MATLAB
Short Tutorial
Reserve word (don’t used it as variable's name)
·
·
·
·
·

ans pi nan inf eps

Special sign
·
·
·
·
·

%
[]
;
'
:

line comment begin - end of matrix row separation, or not echoed command if place in the end of a statement begin - end of string indexing sign

Variable is assume as matrix
% empty matrix
A=[]
A =
[]
% matrix 1x1 or a constant
A=[0]
A =
0
% same with
A=0
A =
0
% complex number: use i or j to express imaginary part z=3+4j z =
3.0000 + 4.0000i

Entry a matrix
% use as column separation and or as row separation
A=[1 2 3; 4 5 6; 7 8 9]
A =
1
4
7

2
5
8

3
6
9

Last saved by jpsugiono 9/23/2011

judi@stts.edu ©2005

p. 2 of 40

How to point element of matrix
% A(row,column)
A(1,3)
ans =
3
% sign use as get all row or column
A(2,:)
ans =
4

5

6

% sign use as get from m to n cell in row or colomn
A(1:2, 2:3) ans =
2
5

3
6

row and column vector
% row vector a=[0 1 2 3 4 5] a =
0

1

2

3

4

5

% column vector b=[0; 1; 3; 4; 5] b =
0
1
3
4
5
% Shortcut to build a vector
% init:step:final a=0:0.2:1 a =
0

0.2000

0.4000

0.6000

String
% begin and end with < ' >, and act like a matrix of character
S='surabaya'

Last saved by jpsugiono 9/23/2011

0.8000

1.0000

judi@stts.edu ©2005

p. 3 of 40

S = surabaya S(1:3) ans = sur Operation
Matrix or constant
+
*
/
\
^
'

Cell by cell operation
(array)
+
.*
./
.\
.^
.'

add substract multiply right division left division power Matrix transpose

Relation
==
~=
>
<
>=
0

0
T

2 bk = ò f (t )sin( kwt ) dt ® k > 0
T 0

w=

2p
(rad / sec)
T

® a0 =

ak
2

k =0

Last saved by jpsugiono 9/23/2011

judi@stts.edu ©2005

p. 39 of 40

If signal input f(t) is continuos, it must be sample for N data point with DT interval sampling. t=nDT T=NDT ω=2p/T=2p/(NDT) f(t)
Periode (T)=N DT
DT

t
DT 2DT

0

3DT 4DT

T

ak =

2
2
ò f (t ) cos(kwt )dt = N DT
T 0
T

bk =

2
2
ò f (t )sin(kwt )dt = N DT
T 0

n.DT
N

å n =1

N

N.DT

æ k 2p nDT f (nDT ) cos ç è N DT

2 æ k 2p nDT ö
÷ DT =
N DT ø
N

å f (nDT ) sin ç è n =1

2 ö ÷ DT =
N
ø

æ k 2p n ö
÷
N ø

N

å f (n) cos ç è n =1

N

æ k 2p n ö
÷
N ø

å f (n) sin ç è n =1

function [avg, ak, bk]=fsctrig(f,t,K,test)
%FSCTRIG find trigonometric fourier series coefficient
%
using trapezoidal rule
%
%[AVG, AK, BK]=FSCTRIG(F, T, K) compute fourier
%
coefficient AVG, A1, ..., AK and
%
B1, B2, ..., BK from 1 periode signal F
%
with time vector T. The approximation of F
%
will store in vector FS with trapezoidal rule.
%
%[AVG, AK, BK]=FSCTRIG(F, T), will compute fourier
%
series coefficient of signal F over time vector T,
%
for first five components
%
%[AVG, AK, BK]=FSCTRIG(F), will compute fourier
%
series coefficient of sequence F, for first five components
%
%[AVG, AK, BK]=FSCTRIG(F, T, K, 1) will plot the result.
%

Last saved by jpsugiono 9/23/2011

judi@stts.edu ©2005

p. 40 of 40

testplot=0; if nargin==4 testplot=1; elseif nargin==2
K=5;
elseif nargin==1; t=0:length(f); K=5; end N=length(f); w=2*pi/N; for k=0:K
Tak=0; Tbk=0; for n=0:N-1
Tak=Tak+f(n+1)*cos(k*w*n);
Tbk=Tbk+f(n+1)*sin(k*w*n); end ak(k+1)=Tak; bk(k+1)=Tbk; end ak=2/N * ak; bk=2/N * bk; avg=ak(1)/2; ak=ak(1,2:K+1) bk=bk(1,2:K+1) if testplot==1
%calculate the FS approximation using FSTRIG
[fs, fak, fbk]=fstrig(t, avg, ak, bk); subplot(221), plot(t,f), title('original function f(t)') xlabel('t'), ylabel('f(t)'), grid subplot(223), plot(t,fs,'-', t, avg,'--', t,fak,'-.', t,fbk,':'), title('Fourier Series Approximation') xlabel('t'), ylabel('f(t)'), grid
Subplot(222), stem(ak), title('Cosine Coefficient') xlabel('k'), ylabel('Ak(k)'), grid
Subplot(224), stem(ak), title('Sine Coefficient') xlabel('k'), ylabel('Bk(k)'), grid end Last saved by jpsugiono 9/23/2011

Similar Documents

Free Essay

Forecasting Models

...MATLAB® Getting Started Guide R2011b How to Contact MathWorks Web Newsgroup www.mathworks.com/contact_TS.html Technical Support www.mathworks.com comp.soft-sys.matlab suggest@mathworks.com bugs@mathworks.com doc@mathworks.com service@mathworks.com info@mathworks.com Product enhancement suggestions Bug reports Documentation error reports Order status, license renewals, passcodes Sales, pricing, and general information 508-647-7000 (Phone) 508-647-7001 (Fax) The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098 For contact information about worldwide offices, see the MathWorks Web site. MATLAB® Getting Started Guide © COPYRIGHT 1984–2011 by The MathWorks, Inc. The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form without prior written consent from The MathWorks, Inc. FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through the federal government of the United States. By accepting delivery of the Program or Documentation, the government hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and conditions of this Agreement and only those rights...

Words: 36443 - Pages: 146

Free Essay

Human Step Detection and Counting with a Microphone (June 2015)

...alternative use of sensors for detecting human movements such as footsteps and that is done for various reasons such as security or just for lightning a lamp automatically. We developed a Simulink model in Matlab to simulate a system that analyses the footsteps of three 25 years old men. Those men had different heights and weights. The data were recorded and analyzed using filtering and conditioning blocks of Matlab. The System collected 3 sets of steps. The first set had 5 steps with 5 detections. The second set had 8 steps with 3 detection and the third set had 4 steps with 1 detections. In total, there were 17 steps where 9 steps were detected. I. C. Procedure During the first part of the experiment, the footsteps were recorded on the main corridor of the first floor of the house 21, located in the University of Kristianstad. We also recorded the steps at our respective houses. The experiment was carried on a floor without carpet to allow a better collection of the data. This procedure was repeated several times, until satisfactory data without much noisy could be acquired. INTRODUCTION T HE objective of this work was to detect the steps of a person using a microphone array embedded in our computer together with the Simulink library of Matlab. We have some background of the idea after reading a few articles regarding this type of experiments. Fig. 1. Simulink models used to record the steps In the articles we read, the experiment...

Words: 1833 - Pages: 8

Free Essay

Curriculum Vitae

...Hafizol Bin Rusli A10-B03 Armanee Terrace Condo, Jalan PJU 8/1 Damansara Perdana 47820 Petaling Jaya, Selangor Darul Ehsan, Malaysia hafizolrusli@gmail.com +(6) 0192672725 https://www.linkedin.com/in/HafizolRusli OBJECTIVE AND SUMMARY To obtain an executive position in a leading organisation that places a substantial emphasis on training and development. A diligent and constant learner who enjoys the challenges of problem solving and seeing issues through to completion either individually or in a team. Previously held numerous high positions in prestigious student organisations and experienced in dealing with distinguished leading figures. I am considered as a hybrid and flexible candidate where I have competent knowledge in both engineering and management background. WORKING EXPERIENCE IOS Ventures Sdn Bhd Executive Administration Assistant | Jan 2015 – May 2015 | • Developed & improved clients contact information by conducting Internet and Telephone research. • Built and maintained the data quality of the company's contacts database. • Contributed to the overall effectiveness of the operation management of the company. EDUCATION AND QUALIFICATIONS Masters in Management | Oct 2015 – Present | Taylors Lakeside University • CGPA: 3.22 • Relevant course: Marketing Management, Organisational Management, Quantitative Method for Business, Managerial Economics, Human Resource Management and Accounting for Decision Making. Bachelor of Engineering...

Words: 462 - Pages: 2

Premium Essay

Questionnaire on Gymnasium

...1.0 INTRODUCTION Pakaq Gomo Gymnasium is about a gym that focuses on health and fitness. By maintaining a healthy lifestyle it basically means being fit mentally and physically. In anybody’s life, there comes a time where they realized that exercising and working is very important for them. The location of Pakaq Gomo Gymnasium is in Wakaf Che Yeh. Wakaf Che Yeh is a city near Kota Bharu that is located at the heart of Kelantan. Based from MBKB, there are almost 500, 00 people that is living in Kota Bharu, it is a good place to start a gymnasium. Pakaq Gomo Gymnasium equipped with such as benches, dumbbell racks, dumbbells and barbells, cable machines and especially many cardio machines. The opening time of Pakaq Gomo Gymnasium will be at 10.00 a.m. until 12.00 a.m. Memberships of the gym will also be given by choice for the customer where the fee will be RM60.00 per month. For the non-members of the gym, they must pay RM4.00 per entry COMPANY BACKGROUND Company name : Pakaq Gomo Gymnasium. Business Address : Pt. 707 Pasar Awam Bersepadu, 15100 Kampong Wakaf Che Yeh Telephone Number : 012-3813826 Main activity : Gymnasium services Date of commencement : 1 January 2011 1.1 PROBLEM STATEMENTS According to Ivyanno Canny and Nila Hidayat (2012) said that “services quality should start from the needs of the customer and ends with the customer satisfaction and positive perceptions of service quality”. Service quality is the most...

Words: 1001 - Pages: 5

Free Essay

Alhamdulillah

...Alhamdulillah, terbuka hatiku untuk postkan esei MARA ku yang tidak seberapa ini. Untuk siapkan esei ni aku bnyk rujuk contoh2 esesi drpd internet. Kini, setelah siap yang ak punya, ak rasa sudah tibalah masa untuk aku membantu org lain, orang yang mungkin melalui pengalaman yang sama mencari contoh esei MARA seperti aku. Rasa bersalah pula kalau aku tidak sebarkan. ME, MY EDUCATION AND CAREER PLANNING Written by : Imran Bin Ariffin, former student of Maktab Sultan Ismail NRIC : 930704-03-5959 My full name is Imran Bin Ariffin, the third child of Ariffin Bin Noor, a doctor posting in Hospital Gua Musang and Kamariah Binti Awang, a Biology teacher at Sekolah Menengah Kebangsaan Sultan Ismail. I have 5 siblings – three brothers and two sisters – with all of them are still studying, two in tertiary education while three others are schooling. We live in a peacefully serene village located not far from Pantai Cahaya Bulan, called Tok Dokang. About my education background, I finished my primary education at Sekolah Rendah Islam Aman (SRI Aman), a private Islamic school which integrates national curriculum and fundamental Islamic studies. Obtained 5 A’s in my Ujian Penilaian Sekolah Rendah (UPSR), I entered Maahad Muhammadi Lelaki (MML), at which I studied for only 3 months before I went to Maahad Tahfiz Sains (MTS), a boarding school in Tanah Merah. Despite the tough 4 years of interdisciplinary study – academics, Islamic subjects and memorization of the Holy Qur’an – at MTS...

Words: 1526 - Pages: 7

Free Essay

Draft

...Diploma in Medical Assistant with CGPA 3.43 applying for clerk position. PERSONAL PARTICULAR | Name | : Nor Ain Farida Binti Abdul Aziz | Gender | : Female | Identity No | : 910207-03-5394 | Date Of Birth | : 7 February 1991 | Nationality | : Malaysian | Race | : Malay | Religion | : Islam | Marital Status | : Single | Height | : 155 Cm | | OFFICIAL CONTACT | Phone No | : 017- 3114603 | Current Address | : No 4-422, Pangsapuri Sri Melewar, Jalan Juruwang AU1/A Sek U1, 40150 Shah Alam, Selangor. | Permanent Address | : No 43, Jalan Laksamana 8, Taman Ungku Tun Aminah, 81300 Skudai, Johor | E-mail | : madina_ieda@yahoo.com | ACADEMIC BACKGROUND | Secondary Education Level | : Sijil Pelajaran Malaysia | | Institution | : SMK Taman Sutera, Johor | | Graduation | : December 2008 | | Result | : Bahasa Melayu | * A1 | | : Bahasa Inggeris | * B3 | | : Pendidikan Islam | * A2 | | : Sejarah | * A2 | | : Matematik | * A2 | | : Matematik Tambahan | * C5 | | : Fizik | * D7 | | : Kimia | * E8 | | : Biologi | * D7 | | : Tasawwur Islam | * B3 | | : English For Science And Technology | * C6 | | Further Education Level | : Diploma In Medical Assistant | | Insitution | : Management And Science University (MSU), Shah Alam | | Graduation | | | Result | : Semester 1 (GPA) | * 3.27 | | : Semester 2 (GPA) | * 3.29 | | : Semester 3 (GPA) | ...

Words: 329 - Pages: 2

Premium Essay

Hr Development in Malaysia

...INTRODUCTION TO HUMAN RESOURCE DEVELOPMENT IN MALAYSIA The human resource development (HRD) can hardly be denied as one of the main reason to boost the development of any country. The objective of Vision 2020 of Malaysia which is to reach the standard of living of industrialized countries by the year 2020 have been clearly communicated and disseminated to all the organizations and its employees. The specific objective of the plan is to accelerate industrial restructuring, technological upgrading, human resource development and industrial linking. HRD being one of the development factor is given priority to support the implementation of a productivity-driven growth which required highly skilled, trainable and knowledgeable manpower. A greater emphasis is continuously given to increase accessibility to education at all levels in line with the democratization of the education policy. At the same time, the long-term objectives of generating a highly skilled labor force to meet the demand of the current economy remains in focus that HRD is a primary element in enhancing the nation’s competitiveness. Under the Tenth Malaysian Plan, one of the main emphasis for achieving productivity is to focus on skills development, especially in terms of upgrading the skills the existing work force to facilitate industries to move up the value chain. Skill development is also more concentrated towards specialization as one of the current ten big plans of the country is to thrive towards transforming...

Words: 2409 - Pages: 10

Free Essay

Student Handbook

...Student Handbook (Procedure & Guideline) for Undergraduate Programmes 2014 Revised: April 2014 UCSI Education Sdn. Bhd. (185479-U) VISION AND MISSION STATEMENT OF UCSI UNIVERSITY VISION STATEMENT To be an intellectually resilient praxis university renowned for its leadership in academic pursuits and engagement with the industry and community MISSION STATEMENT  To promote transformative education that empowers students from all walks of life to be successful individuals with integrity, professionalism and a desire to contribute to society  To optimize relationships between industry and academia through the provision of quality education and unparalleled workplace exposure via Praxis Centres  To spearhead innovation in teaching and learning excellence through unique delivery systems  To foster a sustainable culture of research, value innovation and practice, in partnership with industries and society  To operate ethically at the highest standards of efficiency, while instilling values of inclusiveness, to sustain the vision for future generations 2 UCSI Education Sdn. Bhd. (185479-U) Graduate Attributes Getting a university degree is every student‟s ultimate dream because it opens doors to career opportunities anywhere in the world. A university degree is proof of one‟s intellectual capacity to absorb, utilize and apply knowledge at the workplace. However, in this current competitive world, one‟s knowledge and qualifications...

Words: 28493 - Pages: 114

Free Essay

Essay

...CENTRE FOR GRADUATE STUDIES DEPARTMENT OF ACADEMIC AFFAIRS UNIVERSITI UTARA MALAYSIA To all applicants Graduate Studies Programme Universiti Utara Malaysia Thank you for choosing Universiti Utara Malaysia as your centre for excellence. Kindly please take in to consideration all the matters listed below while filling in the form :   Please fill in the form in block letters using a black pen or a typewriter; All sections must be filled in. State “not applicable” wherever necessary. The following must be submitted together with complete Application Form : Payment slip of the processing fee of RM50.00 for Malaysian applicants. Recepted Bill Payment Slip (BPS) for amount RM50.00 for processing fee which can be paid at any branch of BANK ISLAM MALYSIA BERHAD (BIBM) by using BPS Stating “Payee Code340”. Certified copies of Malaysian Education Certificate (MCE), Degree/equivalent qualifications Malaysian University English Test (MUET) / Teaching English as a Foreign Language (TOEFL) / International English Language Testing System (IELTS), professional certificates and full Academics Transcripts. Applicants in their final semester of first degree must attach certified copies of result for every semester); Scholarship/training award/study loan certification letters; Letter of approval/official leave from employer/relevant authorities to pursue this programme; Copy of research proposal (for applicants doing full research only); Foreign Applicants are requested to send four (4) copies...

Words: 2674 - Pages: 11

Free Essay

Malaysian Students Are Poor Problem Solvers, Survey Says

...Published: Wednesday April 2, 2014 MYT 12:20:00 PM Updated: Wednesday April 2, 2014 MYT 1:32:48 PM Malaysian students are poor problem solvers, survey says BY PATRICK LEE Email Facebook 1K PETALING JAYA: When it comes to problem-solving, Malaysian 15year-olds are among of the world’s poorest, a survey by Programme for International Student Assessment (PISA) has determined. The 2012 survey conducted by the Organisation for Economic Cooperation and Development (OECD) found that more than one in five Malaysian students could not even reach basic levels of problem solving. Malaysia came in at 39th with a mean score of 422 points among the 44 countries surveyed. In comparison, Singapore topped the list of countries with 562 points. Malaysia’s score also put it below the OECD average of 500 points. The survey divided problem solving proficiency into six levels, with Level 6 being the highest and Level 1 being the lowest, though it was added that there was a level below Level 1. “... and in Uruguay, the United Arab Emirates, Montenegro, Malaysia, Brazil and Israel, more than one in five students do not reach this level (Level 1),” the report said. The PISA 2012 report said students proficient at Level 1 can only explore problems given to them in a limited manner. “In general, students at Level 1 can solve straightforward problems provided there is only a simple condition to be satisfied and there are only one or two steps to be performed to reach that goal.” According to the...

Words: 1561 - Pages: 7

Free Essay

Magryb

...islamic leviathan religion and global politics John L. Esposito, Series Editor University Professor and Director Center for Muslim-Christian Understanding Georgetown University islamic leviathan Islam and the Making of State Power Seyyed Vali Reza Nasr Islamic Leviathan Islam and the Making of State Power Ú seyyed vali reza nasr 1 2001 3 Oxford Athens Chennai Kolkata Nairobi New York Auckland Bangkok Bogotá Buenos Aires Cape Town Dar es Salaam Delhi Florence Hong Kong Istanbul Karachi Kuala Lumpur Madrid Melbourne Mexico City Mumbai Paris São Paul Shanghai Singapore Taipei Tokyo Toronto Warsaw and associated comapnies in Berlin Ibadan Copyright © 2001 by Seyyed Vali Reza Nasr Published by Oxford University Press, Inc., 198 Madison Avenue, New York, New York 10016 Oxford is a registered trademark of Oxford University Press All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior permission of Oxford University Press. Library of Congress Cataloging-in-Publication Data Nasr, Seyyed Vali Reza, 1960 – Islamic leviathan : Islam and the making of state power / Seyyed Vali Reza Nasr. p. cm.—(Religion and global politics) Includes bibliographical references and index. ISBN 0-19-514426-0 1. Malaysia—Politics and government. 2. Islam and politics—Malaysia. 3. Pakistan—Politics and government—1988...

Words: 112674 - Pages: 451