Matlab 2020 training course _ Advance

46 22 0
Matlab 2020 training course _ Advance

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Tài liệu này do GV nước ngoài biên soạn. Còn một phần nữa làm về big data và machine learning, bạn nào quan tâm thì nhắn tin nhé. Nhiều file quá nên không thể upload lên đây được. Ngoài ra các bạn có thể tự học trên website của Mathworks. Tài liệu này do GV nước ngoài biên soạn. Còn một phần nữa làm về big data và machine learning, bạn nào quan tâm thì nhắn tin nhé. Nhiều file quá nên không thể upload lên đây được. Ngoài ra các bạn có thể tự học trên website của Mathworks.

Examples and excises codes are free for education goals, contact me via facebook: roland.nam.5 MATLAB PROGRAMMING TECHNIQUES Claire Chuang support@terasoft.com.tw Course Outline ⚫ Increasing Automation with Functions ⚫ Structuring Code ⚫ Creating Robust Applications ⚫ Debugging Code Advanced MATLAB® Programming Techniques Increasing Automation with Functions Section Outline ⚫ Creating functions ⚫ Calling functions ⚫ Workspaces ⚫ Path and precedence Why Use Functions? Increasing Automation % Create the time base for the signal fs = 4000; t = 0:(1/fs):1.5; f0 A0 B fm % Create the harmonics y0 = sin(2*pi*f0*t) + sin(2*pi*2*f0*t) + sin(2*pi*3*f0*t); % Set the additional parameters in the model A0 = 2; % Initial amplitude B = 1.5; % Amplitude decay rate fm = 0.65; % Frequency of the modulating envelope % Create the envelope A = A0*exp(-B*t).*sin(2*pi*fm*t); % Create the call call = A.*y0; % Plot the model call and listen to it figure plot(t,call) xlabel('Time') ylabel('Amplitude') title('{\bf Blue Whale B Call Model}') soundsc(call,fs) t call callmodel.m % Set the fundamental frequency of the call f0 = 175; Creating a Function Function declaration: Keyword Output arguments Function name Input arguments Calling a Function callmodel_fun.m Workspaces foo.m 42 0.7623 BlackBox™ Calling Precedence >> whale Variable Nested function Local function Private function Class method Overloaded method File in the current directory File on the path whale.bi whale.mexw32 whale.mdl whale.p whale.m ... = [x,y] C [x,y] = function foo(a,b) D [x,y] = foo[a,b] Exercise: Shift Cipher MATLAB +5 MATLAB -5 RFYQFG Advanced MATLAB? ? Programming Techniques Structuring Code Section Outline ⚫ Private functions.. .Course Outline ⚫ Increasing Automation with Functions ⚫ Structuring Code ⚫ Creating Robust Applications ⚫ Debugging Code Advanced MATLAB? ? Programming Techniques... File in the current directory File on the path whale.bi whale.mexw32 whale.mdl whale.p whale.m The MATLAB? ? Path >> pathtool search in order Chapter Test Your Knowledge Suppose the workspace contains

Ngày đăng: 23/09/2020, 16:26

Tài liệu cùng người dùng

Tài liệu liên quan