e422.asv
来自「学习Matlab循环语句的好例子」· ASV 代码 · 共 34 行
ASV
34 行
% 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 + =
减小字号Ctrl + -
显示快捷键?