当前位置:网站首页>11. conditional statement if, switch
11. conditional statement if, switch
2022-06-11 23:43:00 【fpga&matlab】
---------------------------------------------------------------------------------------
if
Condition is true Execute statement , The basic grammar is as follows :
if Conditions 1
perform 1
elseif Conditions 2
perform 2
elseif Conditions 3
perform 3
else
perform 4
end
Examples are as follows :
clc;
clear;
close all;
warning off;
Y = 10*rand
if Y>0 & Y<=2;
B=1 ;
elseif Y>2 & Y<=4;
B=2 ;
elseif Y>4 & Y<=6;
B=3 ;
else
B=4 ;
end
BThe meaning of this code is , Randomly produce a 0~10 Random number between Y, And then determine Y Size ,
If Y stay 0~2 Between ,B The assignment is 1,
If Y stay 2~4 Between ,B The assignment is 2,
If Y stay 4
边栏推荐
- How to completely modify the user name in win10 system and win11 system
- Acwing's first question solution attracted the first fan!!! Happy~~~
- 抗原產品進入家庭,中國醫療器械企業迎來新藍海
- (dp) acwing 899. Edit distance
- 【delphi】判断文件的编码方式(ANSI、Unicode、UTF8、UnicodeBIG)
- ETF operation record: March 1, 2022
- oracle中dblink操作
- C collection of questions for project review
- Ar helps brand stores achieve global data growth
- Custom font settings
猜你喜欢

Mysql5 and mysql8 are installed at the same time

(dp) acwing 899. Edit distance

Acwing's first question solution attracted the first fan!!! Happy~~~

Ar helps brand stores achieve global data growth

2022 operation of simulation examination platform for safety officer C certificate

Unity3d C # development of wechat games audio / sound playback problem solving process sharing

Test case design method

明德扬FPGA开发板XILINX-K7核心板Kintex7 XC7K325 410T工业级

Lake Shore - supertran VP continuous flow cryogenic thermostat system

On the knowledge points of cookie attributes and the differences between webstorage and cookies?
随机推荐
I2C read / write process
Lake shore vnf series low temperature thermostat system - sample in flowing steam
MySQL some simple commands
How to construct PostgreSQL error codes
What is webstorage? And cookies
Integrate工具之Jenkins
Top selling commodities 【 project mall 】
Jenkins basic configuration
C collection of questions for project review
PHP mkdir(): Permission denied上传文件会把文件夹权限改为411权限
Display product details [project mall]
Setting alias alias and @ reference note
Two way leading circular linked list (C language)
mysql5和mysql8同时安装
2022 low voltage electrician certificate and online simulation examination
Lake Shore - supervaritemp low temperature thermostat
Figure overview of neural network
What are the pitfalls of redis's current network: using a cache and paying for disk failures?
2022年高处安装、维护、拆除操作证考试题库模拟考试平台操作
JS common method collection