MATLAB Fundamentals>>>(2/2) Reserved Keywords MATKAB保留关键字有哪些?

MATLAB Fundamentals>Programming Constructs>Course Example - Comparing Prices>(2/2) Reserved Keywords


任务1:

Keywords are reserved words with special meanings.

To see a list of MATLAB programming keywords, type:iskeyword

解答1:

iskeyword

结果1:关键字一共20个,如下

'break'
'case'
'catch'
'classdef'
'continue'
'else'
'elseif'
'end'
'for'
'function'
'global'
'if'
'otherwise'
'parfor'
'persistent'
'return'
'spmd'
'switch'
'try'
'while'

附加练习:

MATLAB programs can make use of keywords to control execution of the code. Keywords are the basic programming components of the MATLAB language. You can use them to build programming constructs that allow your programs to make decisions or repeat a procedure multiple times. Use these constructs to make your code more robust, more flexible, and more maintainable.

MATLAB will not allow you to use a keyword as a variable.

end = pi
end = pi
    ↑
Error: Illegal use of reserved keyword "end".

笔记:

MATLAB程序可以利用关键字来控制代码的执行。关键字是MATLAB语言的基本编程组件。您可以使用它们来构建编程结构,使您的程序能够多次做出决策或重复一个过程。使用这些构造可以使代码更健壮、更灵活、更易于维护。
MATLAB不允许您将关键字用作变量。

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-03 09:16:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-03 09:16:01       101 阅读
  3. 在Django里面运行非项目文件

    2024-02-03 09:16:01       82 阅读
  4. Python语言-面向对象

    2024-02-03 09:16:01       91 阅读

热门阅读

  1. 【Redis】理论基础 - 持久化

    2024-02-03 09:16:01       48 阅读
  2. 8-Docker网路模式之自定义网络

    2024-02-03 09:16:01       60 阅读
  3. curl之网络接口

    2024-02-03 09:16:01       61 阅读
  4. Spring MVC 框架无法找到合适的消息转换器

    2024-02-03 09:16:01       46 阅读
  5. CSS 选择器与相关规则详解

    2024-02-03 09:16:01       54 阅读
  6. JeecgBoot 3.6.1 vue页面定时刷新列表

    2024-02-03 09:16:01       53 阅读