6 程序设计:控制流和M文件.pptxVIP

  • 3
  • 0
  • 约1.48千字
  • 约 46页
  • 2017-05-19 发布于山西
  • 举报
6 程序设计:控制流和M文件

MATLAB程序设计 控制流和M文件;大纲;一、程序控制;条件控制;关键字不能被用户自定义使用;if 条件控制语句;a = randi(100, 1); if a 30 disp(small) elseif a 80 disp(medium) else disp(large) end;?;?;MATLAB代码;switch条件控制语句;x = [12 64 24]; plottype = pie3; switch plottype case bar bar(x) title(Bar Graph) case {pie,pie3} pie3(x) title(Pie Chart) otherwise warning(Unexpected plot type. No plot created.) end;result = 52; switch(result) case 52 disp(result is 52) case {52, 78} disp(result is 52 or 78) end;grade = 70; switch grade case grade = 90

文档评论(0)

1亿VIP精品文档

相关文档