当前位置:网站首页>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
边栏推荐
- RF中使用reuqests的两种方式
- CD流程
- Detailed explanation of various objects in browser object
- Custom font settings
- (simple statistics) acwing 3404 Who are your potential friends
- 2022 safety officer-a certificate test question simulation test platform operation
- Fonctionnement de la plate - forme d'examen de simulation pour les agents de sécurité - Questions d'examen de certificat a en 2022
- 栈(C语言)
- How many steps does it take for C language to become Fibonacci number
- Top selling commodities 【 project mall 】
猜你喜欢

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

Solr之基礎講解入門

A new product with advanced product power, the new third generation Roewe rx5 blind subscription is opened

Class. Getresource() and class Getresourceasstream() method

Wechat applet Bluetooth development

2022年高处安装、维护、拆除操作证考试题库模拟考试平台操作

sonarqube介紹和安裝步驟

Simulated examination question bank and simulated examination of 2022 crane driver (limited to bridge crane)

The latest "capsule Network Overview" paper of imperial technology, etc., 29 pages of PDF, expounds the concept, method and application of capsule

Pad printing process flow and application precautions
随机推荐
Procédures d'introduction et d'installation de sonarqube
Jetpack架构组件学习(3)——Activity Results API使用
抗原产品进入家庭,中国医疗器械企业迎来新蓝海
Lake Shore—SuperTran-VP 连续流低温恒温器系统
SAP SD 创建/修改价格表
2022年高处安装、维护、拆除操作证考试题库模拟考试平台操作
The latest "capsule Network Overview" paper of imperial technology, etc., 29 pages of PDF, expounds the concept, method and application of capsule
2022 operation of simulation examination platform for safety officer C certificate
产品力进阶新作,全新第三代荣威RX5盲订开启
Unity3d C # development of wechat games audio / sound playback problem solving process sharing
Teach you to play with SSM framework
2022年安全員-A證考題模擬考試平臺操作
Simulated examination question bank and simulated examination of 2022 crane driver (limited to bridge crane)
移印工艺流程及应用注意事项
Share a treasure website necessary for new media operation for free
Class. Getresource() and class Getresourceasstream() method
DOM知识点总结
Software installation and use, etc
Ar helps brand stores achieve global data growth
多路查找树