我无法理解以下代码的含义:
1:5/3:5
这,据我所知,转换为
1.0e+00 2.0e+00 3.0e+00 4.0e+00 5.0e+00 / 3.0e+00 4.0e+00 5.0e+00
答案是:
1.0e+00 2.6e+00 4.3e+00
我的问题是:这里到底做了什么?
答案 0 :(得分:3)
假设以下代码
a:b:c
它将以a和b的步长打印a和c之间的值。
所以,如果a = 1; B = 5/3; c = 5,它将打印
1
1 + 1 * 5/3
1 + 2 * 5/3
...
只要该值低于或等于5
答案 1 :(得分:2)
理解它的最好方法是查看MATLAB' operator precedence。
感兴趣的是:
- 乘法
醇><!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Carousel with bxSlider</title> <link href="styles.css" type="text/css" rel="stylesheet"> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"> </script> <script type="text/javascript" src="http://code.jquery.com/jquery- 1.8.3.min.js"></script> <script type="text/javascript" src="js/jquery.bxSlider.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#slider").bxSlider({ displaySlideQty: 1, moveSlideQty: 1, default: false, options: (true/false) } ); }); </script> </head> <body> <section> <h1>About Us</h1> <p>On June 6th, 2012, Vecta Corp. moved into its new 4 story, 35,000 square foot facilty. Below are a few pictures of the new facility.</p> <p id="caption"></p> <ul id="slider"> <li><img src="images/building_01_thumb.jpg" title="Front of building" width="200"></li> <li><img src="images/building_02_thumb.jpg" title="Left side of building" width="200"></li> <li><img src="images/building_03_thumb.jpg" title="Rear of building" width="200"></li> <li><img src="images/building_04_thumb.jpg" title="Offices" width="200"></li> <li><img src="images/building_05_thumb.jpg" title="Conference room" width="200"></li> </ul> <p id="pager"></p> </section> </body> </html>
,右分割(.*)
,左分割(./)
,矩阵乘法(.\)
,矩阵右分割(*)
,矩阵左 师(/)
...
- 冒号操作员
醇>(\)
因此在colon
operation之前评估(:)
并将其用作增量。如果我们要做5/3
,那么行为就像你在上面猜到的那样。并且您会收到错误,因为尺寸与正确的矩阵划分不兼容。