⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e422.asv

📁 学习Matlab循环语句的好例子
💻 ASV
字号:
% Script file:E422.m
% Purpose:
% Write a program that calculates and plots the number of bacteria present 
% in each culture at intervals of 3 hours from the beginning of experiment
% until 24 hours have elapsed

% Record of revisions
%   Date           Programmer            Descripton of changes
% =============   ===============  ================================
%  13/06/08         ZMW                Original Code

% Define Variables
% t   ----------the time,hour as unit
% numA ----------bacteria A's number
% numB ----------bacteria B's number
% ii    ---------the index

numA=zeros(1,9);
numB=zeros(1,9);
ii=1;
for t=0:3:24
    numA(ii)=2^t;
    numB(ii)=2^(2*t./3);
    ii=ii+1;
end
t=0:3:24;
hold on 
plot(t,numA,'b-');
plot(t,numB,'k-');
title('\bf t VS num(plot)');
hold off


    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -