{"id":3993,"date":"2012-09-09T09:56:45","date_gmt":"2012-09-09T09:56:45","guid":{"rendered":"http:\/\/uranchimeg.com\/Education\/?p=3993"},"modified":"2012-11-21T09:54:20","modified_gmt":"2012-11-21T09:54:20","slug":"mit-%d0%bd-matlab-%d1%85%d0%b8%d1%87%d1%8d%d1%8d%d0%bb-%e2%84%96-3","status":"publish","type":"post","link":"https:\/\/uranchimeg.com\/Education\/?p=3993","title":{"rendered":"MIT-\u043d MATLAB \u0445\u0438\u0447\u044d\u044d\u043b. \u2116 3"},"content":{"rendered":"<p>\u0425\u0438\u0447\u044d\u044d\u043b \u2116 3.<\/p>\n<h2>\u041c\u0430\u0442\u0440\u0438\u0446\u044b\u043d \u0433\u0438\u043d\u0436\u0438\u043d \u0445\u043e\u043b\u0431\u043e\u043e<\/h2>\n<p>\u0425\u0430\u0430\u043b\u0442\u044b\u0433 \u0430\u0448\u0438\u0433\u043b\u0430\u043d \u0438\u043b\u04af\u04af \u043d\u0438\u0439\u043b\u043c\u044d\u043b \u043c\u0430\u0442\u0440\u0438\u0446\u044b\u0433 \u04af\u04af\u0441\u0433\u044d\u0436 \u0431\u043e\u043b\u043d\u043e:<\/p>\n<p>&gt;&gt; [ones(2,2) zeros(2,2)]<\/p>\n<p>&gt;&gt; [ones(2,2) ; zeros(2,2)]<\/p>\n<h4>\u0414\u0430\u0441\u0433\u0430\u043b<\/h4>\n<ul>\n<li>\u042d\u0445\u043d\u0438\u0439 \u0431\u0430\u0433\u0430\u043d\u0430 \u043d\u044c 1:10 \u0433\u044d\u0441\u044d\u043d \u0442\u043e\u043e\u043d\u0443\u0443\u0434\u044b\u0433, \u0434\u0430\u0440\u0430\u0430\u0433\u0438\u0439\u043d \u0431\u0430\u0433\u0430\u043d\u0430 \u043d\u044c \u044d\u0445\u043d\u0438\u0439 \u0431\u0430\u0433\u0430\u043d\u044b\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u04af\u04af\u0434\u0438\u0439\u043d \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0443\u0442\u0433\u044b\u0433 \u0441\u04af\u04af\u043b\u0447\u0438\u0439\u043d \u0431\u0430\u0433\u0430\u043d\u0430 \u043d\u044c \u044d\u0445\u043d\u0438\u0439 \u0431\u0430\u0433\u0430\u043d\u044b\u043d \u0433\u0443\u0440\u0432\u0430\u043d \u0437\u044d\u0440\u044d\u0433\u0442\u0438\u0439\u0433 \u0430\u0433\u0443\u0443\u043b\u0441\u0430\u043d \u043c\u0430\u0442\u0440\u0438\u0446 \u04af\u04af\u0441\u0433\u044d.<\/li>\n<\/ul>\n<h2>\u0418\u043b\u044d\u0440\u0445\u0438\u0439\u043b\u043b\u04af\u04af\u0434<\/h2>\n<p>\u0411\u04af\u0445 Matlab \u0438\u043b\u044d\u0440\u0445\u0438\u0439\u043b\u043b\u04af\u04af\u0434 \u0434\u0430\u0440\u0430\u0430\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u04af\u04af\u0434\u0438\u0439\u0433 \u04e9\u04e9\u0440\u0442\u04e9\u04e9 \u0430\u0433\u0443\u0443\u043b\u0441\u0430\u043d \u0431\u0430\u0439\u0434\u0430\u0433:<\/p>\n<ul>\n<li>\u0422\u043e\u0433\u0442\u043c\u043e\u043b &#8211; Constants<\/li>\n<li>\u0425\u0443\u0432\u044c\u0441\u0430\u0433\u0447 &#8211; Variables<\/li>\n<li>\u04ae\u0439\u043b\u0434\u043b\u0438\u0439\u043d \u0442\u044d\u043c\u0434\u044d\u0433 &#8211; Operators<\/li>\n<li>\u0422\u04af\u043b\u0445\u04af\u04af\u0440 \u04af\u0433 &#8211; Keywords<\/li>\n<li>\u0424\u0443\u043d\u043a\u0446 &#8211; Functions<\/li>\n<\/ul>\n<h3>\u0422\u043e\u0433\u0442\u043c\u043e\u043b<\/h3>\n<p>\u04e8\u043c\u043d\u04e9\u0445 \u0445\u0438\u0447\u044d\u044d\u043b\u04af\u04af\u0434\u044d\u0434 \u0430\u0448\u0438\u0433\u043b\u0430\u0441\u0430\u043d 1, 3, 1.56, -5, pi \u0437\u044d\u0440\u044d\u0433 \u043d\u044c \u0442\u043e\u0433\u0442\u043c\u043e\u043b\u0443\u0443\u0434 \u044e\u043c. \u04ae\u04af\u043d\u044d\u044d\u0441 \u0433\u0430\u0434\u043d\u0430:\u00a0i, j,\u00a0(root of -1),\u00a02.4e12\u00a0(2.4 times 10^12),\u00a0&#8216;a&#8217;\u00a0(the character a),&#8217;hello&#8217;\u00a0(a vector consisting of the letters\u00a0&#8216;h&#8217;,&#8217;e&#8217;,&#8217;l&#8217;,&#8217;l&#8217;,&#8217;o&#8217;) \u0437\u044d\u0440\u044d\u0433 \u043d\u044c \u043c\u04e9\u043d \u00a0\u043b \u0442\u043e\u0433\u0442\u043c\u043e\u043b\u0443\u0443\u0434 \u044e\u043c. \u00a0 i \u0431\u043e\u043b\u043e\u043e\u0434 j-\u0433 \u0445\u0443\u0432\u044c\u0441\u0430\u0433\u0447\u0430\u0430\u0441 \u04e9\u04e9\u0440\u04e9\u04e9\u0440 \u0430\u0448\u0438\u0433\u043b\u0430\u0436 \u0431\u043e\u043b\u043d\u043e: 3i \u044d\u0441\u0432\u044d\u043b -15j \u0433\u044d\u0436 \u0431\u0438\u0447\u0438\u0436 \u0431\u043e\u043b\u043d\u043e. \u0413\u044d\u0445\u0434\u044d\u044d \u0445\u044d\u0440\u044d\u0432 a=10 \u0445\u044d\u043c\u044d\u044d\u043d \u0437\u0430\u0440\u043b\u0430\u0436 \u04e9\u0433\u0441\u04e9\u043d \u0431\u043e\u043b 4a \u0433\u044d\u0436 \u0431\u0438\u0447\u0438\u0436 \u0431\u043e\u043b\u043e\u0445\u0433\u04af\u0439&#8230; \u041c\u04e9\u043d Matlab \u043f\u0440\u043e\u0433\u0440\u0430\u043c \u0442\u043e\u0434\u043e\u0440\u0445\u043e\u0439\u043b\u043e\u043b\u0442\u044b\u043d \u0445\u043e\u0441 \u0446\u044d\u0433\u0438\u0439\u0433 \u0430\u0448\u0438\u0433\u043b\u0430\u0445\u044b\u0433 \u0437\u04e9\u0432\u0448\u04e9\u04e9\u0440\u0434\u04e9\u0433:&#8217;a&#8217;:&#8217;z&#8217;.<\/p>\n<p>\u04e8\u04e9\u0440 \u0432\u0435\u043a\u0442\u043e\u0440\u044b\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044d\u0434 \u0434\u0430\u0440\u0430\u0430\u0445 \u0431\u0430\u0439\u0434\u043b\u0430\u0430\u0445 \u0445\u0430\u043d\u0434\u0430\u0436 \u0431\u043e\u043b\u043d\u043e:<\/p>\n<p>&gt;&gt; a=&#8217;hello&#8217;<\/p>\n<p>&gt;&gt; a(2)<\/p>\n<p>&gt;&gt; a(4:5)=&#8217;p!&#8217;<\/p>\n<h4>\u0414\u0430\u0441\u0433\u0430\u043b:<\/h4>\n<ul>\n<li>&#8216;zyx&#8230;.cba&#8217; \u0442\u044d\u043c\u0434\u044d\u0433\u0442\u044d\u044d\u0441 \u0431\u04af\u0440\u0434\u0441\u044d\u043d \u043c\u04e9\u0440 \u0431\u04af\u0442\u044d\u044d<\/li>\n<li>&#8216;Hello!!&#8217; \u0431\u0430 &#8216;Goodbye&#8217; (&#8216;HGeolold&#8230;.!e&#8217; \u0433\u044d\u0441\u044d\u043d \u0445\u044d\u043b\u0431\u044d\u0440\u044d\u044d\u0440) \u0433\u044d\u0441\u044d\u043d \u043c\u04e9\u0440\u04af\u04af\u0434\u0438\u0439\u0433 \u0445\u043e\u043b\u044c\u0441\u043e\u043d \u043c\u04e9\u0440 \u04af\u0441\u0441\u0433\u044d<\/li>\n<\/ul>\n<h3>\u0425\u0443\u0432\u044c\u0441\u0430\u0433\u0447\u0438\u0434<\/h3>\n<p>\u0425\u0443\u0432\u044c\u0441\u0430\u0433\u0447\u0438\u0439\u043d \u043d\u044d\u0440 \u0437\u0430\u0430\u0432\u0430\u043b \u04af\u0441\u0433\u044d\u044d\u0440 \u044d\u0445\u043b\u044d\u0445 \u0451\u0441\u0442\u043e\u0439 \u0431\u04e9\u0433\u04e9\u04e9\u0434 \u0443\u0440\u0442 \u043d\u044c 32 \u0442\u044d\u043c\u0434\u044d\u0433\u0442\u044d\u044d\u0441 \u0445\u044d\u0442\u0440\u044d\u0445 \u0451\u0441\u0433\u04af\u0439. \u04ae\u0441\u044d\u0433 \u0442\u043e\u043e\u043d\u043e\u043e\u0441 \u0433\u0430\u0434\u043d\u0430 \u0434\u043e\u043e\u0433\u0443\u0443\u0440 \u0437\u0443\u0440\u0430\u0430\u0441 \u00a0&#8216;_&#8217; \u043e\u0440\u0441\u043e\u043d \u0431\u0430\u0439\u0436 \u0431\u043e\u043b\u043d\u043e.<\/p>\n<p>Matlab-\u0434 \u043c\u0430\u0442\u0440\u0438\u0446 \u0431\u043e\u043b\u043e\u043e\u0434 \u0432\u0435\u043a\u0442\u043e\u0440\u044b\u043d \u04e9\u0433\u04e9\u0433\u0434\u04e9\u04e9\u0433\u04af\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u04af\u04af\u0434\u0438\u0439\u0433 \u0442\u044d\u0433\u044d\u044d\u0440 \u0434\u04af\u04af\u0440\u0433\u044d\u0436 \u0431\u043e\u043b\u0434\u043e\u0433:<\/p>\n<p>&gt;&gt; a = [1 2 ; 3 4]<\/p>\n<p>&gt;&gt; a(5,5) = 1<\/p>\n<h3>\u04ae\u0439\u043b\u0434\u043b\u0438\u0439\u043d \u0442\u044d\u043c\u0434\u044d\u0433\u04af\u04af\u0434<\/h3>\n<p>\u041c\u0430\u0442\u043b\u0430\u0432:\u00a0=,+,-,\/,*,^,.,&#8217;,[,],(,),;,: \u0433\u044d\u0441\u044d\u043d \u04af\u0439\u043b\u0434\u043b\u0438\u0439\u043d \u0442\u044d\u043c\u0434\u044d\u0433\u04af\u04af\u0434\u0438\u0439\u0433 \u0430\u0433\u0443\u0443\u043b\u0434\u0430\u0433.<\/p>\n<h3>\u0422\u04af\u043b\u0445\u04af\u04af\u0440 \u04af\u0433<\/h3>\n<p>\u041e\u0434\u043e\u043e\u0445\u043e\u043d\u0434\u043e\u043e \u0431\u0438\u0434 \u043e\u043b\u043e\u043d \u0442\u04af\u043b\u0445\u04af\u04af\u0440 \u04af\u0433 \u04af\u0437\u044d\u044d\u0433\u04af\u0439 \u0431\u0430\u0439\u0433\u0430\u0430. end \u0431\u043e\u043b \u0431\u0438\u0434\u043d\u0438\u0439 \u043e\u0434\u043e\u043e\u0433\u043e\u043e\u0440 \u04af\u0437\u0441\u044d\u043d \u0442\u04af\u043b\u0445\u04af\u04af\u0440 \u04af\u0433 \u044e\u043c.<\/p>\n<h3>\u0424\u0443\u043d\u043a\u0446<\/h3>\n<p>ones, zeros, diag, size \u0433\u044d\u0441\u044d\u043d \u0444\u0443\u043d\u043a\u0446\u04af\u04af\u0434\u0438\u0439\u0433 \u0431\u0438\u0434 \u04e9\u043c\u043d\u04e9\u0445 \u0445\u0438\u0447\u044d\u044d\u043b\u04af\u04af\u0434\u044d\u044d\u0440 \u04af\u0437\u0441\u044d\u043d. \u04ae\u04af\u043d\u044d\u044d\u0441 \u0433\u0430\u0434\u043d\u0430 \u04e9\u04e9\u0440 \u043e\u043b\u043e\u043d \u0444\u0443\u043d\u043a\u0446 \u0431\u0430\u0439\u0434\u0430\u0433. \u0416\u0438\u044d\u044d\u043b\u0431\u044d\u043b:\u00a0sin, cos, exp, log, sqrt. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0444\u0443\u043d\u043a\u0446\u04af\u04af\u0434\u0438\u0439\u0433 \u0434\u0443\u0443\u0434\u0430\u043d \u0430\u0448\u0438\u0433\u043b\u0430\u0436 \u0431\u043e\u043b\u043e\u0445\u043e\u043e\u0441 \u0433\u0430\u0434\u043d\u0430 \u0445\u044d\u0440\u044d\u0433\u043b\u044d\u0433\u0447 \u04e9\u04e9\u0440\u04e9\u04e9 \u0444\u0443\u043d\u043a\u0446 \u04af\u04af\u0441\u0433\u044d\u0436 \u0431\u043e\u043b\u0434\u043e\u0433. \u04ae\u04af\u043d\u0438\u0439\u0433 \u0431\u0438\u0434 \u0434\u0430\u0440\u0430\u0430 \u0434\u0430\u0440\u0430\u0430\u0433\u0438\u0439\u043d \u0445\u0438\u0447\u044d\u044d\u043b\u044d\u044d\u0440 \u04af\u0437\u044d\u0445 \u0431\u043e\u043b\u043d\u043e.<span style=\"font-family: arial, sans-serif;\">\u00a0<\/span><\/p>\n<h2>\u0413\u0440\u0430\u0444\u0438\u043a \u0437\u0443\u0440\u0430\u0445<\/h2>\n<p>Matlab \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0430\u0430\u0440 \u0433\u043e\u0451 \u0441\u0430\u0439\u0445\u0430\u043d \u0437\u0443\u0440\u0430\u0433\u043b\u0430\u043b \u0434\u04af\u0440\u0441\u044d\u043b\u0436 \u0431\u043e\u043b\u0434\u043e\u0433. \u0417\u0443\u0440\u0430\u0445 \u0431\u043e\u043b Matlab \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u044b\u043d \u04af\u043d\u0434\u0441\u044d\u043d \u0445\u044d\u0440\u044d\u0433\u043b\u044d\u0433\u0434\u044d\u0445\u04af\u04af\u043d \u0431\u043e\u043b\u043e\u043c\u0436\u0443\u0443\u0434\u044b\u043d \u043d\u044d\u0433 \u044e\u043c. \u0414\u04af\u0440\u0441\u043b\u044d\u043b \u0437\u0443\u0440\u0433\u0438\u0439\u0433 \u0438\u0445\u044d\u043d\u0445\u0434\u044d\u044d \u0446\u044d\u0433\u044d\u044d\u0440 \u0438\u043b\u044d\u0440\u0445\u0438\u0439\u043b\u0436 \u0443\u043b\u043c\u0430\u0430\u0440 \u0446\u044d\u0433\u0438\u0439\u043d \u0437\u0430\u0439\u043d \u04e9\u04e9\u0440\u0447\u043b\u04e9\u043b\u0442\u04e9\u04e9\u0440 \u0434\u04af\u0440\u0441\u044d\u043b\u043d\u044d. \u0416\u0438\u0448\u044d\u044d\u0433\u044d\u044d\u0440 \u044d\u043d\u044d \u044f\u043b\u0433\u0430\u0430\u0433 \u043e\u0439\u043b\u0433\u043e\u0445\u043e\u0434 \u0434\u04e9\u0445\u04e9\u043c\u0442\u044d\u0439 \u0431\u0430\u0439\u0434\u0430\u0433:<span style=\"font-family: arial, sans-serif;\">\u00a0<\/span><\/p>\n<p>&gt;&gt; x = 0:0.01:1 ;<\/p>\n<p>&gt;&gt; y = sin(x) ;<\/p>\n<p>&gt;&gt; plot(x,y)<span style=\"font-family: arial, sans-serif;\">\u00a0<\/span><\/p>\n<p>\u041d\u044d\u043c\u044d\u043b\u0442 \u0442\u0430\u0439\u043b\u0431\u0430\u0440.<\/p>\n<p>1. \u0426\u044d\u0433 \u0442\u0430\u0441\u043b\u0430\u043b. &#8216;;&#8217; -\u0433 \u043c\u04e9\u0440\u0438\u0439\u0433 \u0442\u04e9\u0433\u0441\u0433\u04e9\u043b\u0434 \u0431\u0438\u0447\u0438\u0436 \u04e9\u0433\u0441\u043d\u04e9\u04e9\u0440 \u0437\u0443\u0440\u0433\u0438\u0439\u0433 &#8220;\u0433\u0430\u0440\u0433\u0430&#8221; \u0433\u044d\u0441\u044d\u043d \u0441\u0430\u043d\u0430\u0430\u0433 \u0438\u043b\u044d\u0440\u0445\u0438\u0439\u043b\u0436 \u0431\u0430\u0439\u0434\u0430\u0433. \u0413\u044d\u0445\u0434\u044d\u044d \u0438\u0439\u043c \u0431\u0438\u0447\u0438\u0433\u043b\u044d\u043b\u044d\u044d\u0440 \u0442\u04e9\u0433\u0441\u0433\u04e9\u043b\u0434 \u043d\u044c \u0431\u0438\u0447\u0438\u0436 \u04e9\u0433\u04e9\u04e9\u0433\u04af\u0439\u0433\u044d\u044d\u0441 \u0434\u04af\u0440\u0441\u043b\u044d\u043b \u0437\u0443\u0440\u0430\u0433\u0434\u0430\u0445\u0433\u04af\u0439 \u0433\u044d\u0441\u044d\u043d \u04af\u0433 \u0431\u0438\u0448 \u044e\u043c. \u0426\u044d\u0433 \u0442\u0430\u0441\u043b\u0430\u043b \u0431\u0438\u0447\u0438\u0445\u0433\u04af\u0439 \u0431\u043e\u043b \u0434\u044d\u043b\u0433\u044d\u0446 \u0434\u044d\u044d\u0440 \u0437\u0443\u0440\u0430\u0433 \u0433\u0430\u0440\u0430\u0445\u0433\u04af\u0439.<\/p>\n<p>2. plot \u00a0\u0444\u0443\u043d\u043a\u0446\u044d\u044d\u0440 \u0431\u0438\u0434 \u0441\u0430\u0439\u0445\u0430\u043d \u0434\u04af\u0440\u0441\u043b\u044d\u043b \u0433\u0430\u0440\u0433\u0430\u0436 \u0431\u043e\u043b\u043d\u043e. \u042d\u043d\u044d \u04af\u0439\u043b\u0434\u043b\u0438\u0439\u0433 \u04e9\u04e9\u0440 \u0444\u0443\u043d\u043a\u0446 \u0434\u044d\u044d\u0440 \u0442\u0443\u0440\u0448\u0430\u0430\u0440\u0430\u0439.<\/p>\n<h4>\u0414\u0430\u0441\u0433\u0430\u043b:<\/h4>\n<table>\n<tbody>\n<tr>\n<td><img loading=\"lazy\" src=\"http:\/\/ocw.mit.edu\/ans7870\/resources\/farjoun\/lissajou2.jpg\" alt=\"\" width=\"96\" height=\"86\" \/><img loading=\"lazy\" src=\"http:\/\/ocw.mit.edu\/ans7870\/resources\/farjoun\/heart2.jpg\" alt=\"\" width=\"96\" height=\"86\" \/><\/td>\n<td>\n<ul>\n<li>sin \u0444\u0443\u043d\u043a\u0446\u0438\u0439\u0433 \u04e9\u04e9\u0440 \u0430\u043b\u0445\u0430\u043c\u0442\u0430\u0439\u0433\u0430\u0430\u0440 \u0437\u0443\u0440<\/li>\n<li>\u0418\u043b\u04af\u04af \u0438\u0445 \u043d\u0443\u0433\u0430\u043b\u0430\u0440\u0441\u0430\u043d \u0444\u0443\u043d\u043a\u0446 sin-\u0433 \u0430\u0448\u0438\u0433\u043b\u0430\u043d \u0437\u0443\u0440<\/li>\n<li>-5 \u0430\u0430\u0441 5-\u043d \u0445\u043e\u043e\u0440\u043e\u043d\u0434 x^2 \u0444\u0443\u043d\u043a\u0446\u0438\u0439\u0433 \u0437\u0443\u0440<\/li>\n<li>1-\u044d\u044d\u0441 1?-\u043d \u0445\u043e\u043e\u0440\u043e\u043d\u0434 log(x) \u0444\u0443\u043d\u043a\u0446 \u0437\u0443\u0440. \u0417\u0443\u0440\u0430\u0433 \u0447\u0438\u043d\u044c \u043d\u0430\u0440\u0438\u0439\u043d \u0433\u043e\u0451\u043c\u0441\u043e\u0433 \u0445\u0430\u0440\u0430\u0433\u0434\u0430\u0445 \u0434\u044d\u044d\u0440 \u0430\u043d\u0445\u0430\u0430\u0440.<\/li>\n<li>\u0442\u043e\u0439\u0440\u043e\u0433 \u0437\u0443\u0440<\/li>\n<li><a title=\"Lissajous curve\" href=\"http:\/\/en.wikipedia.org\/wiki\/Lissajous_curve\" target=\"_blank\">Lissajou curve<\/a> \u0437\u0443\u0440.<\/li>\n<li>&#8220;\u0437\u04af\u0440\u0445&#8221; \u0437\u0443\u0440. r = sin(theta\/2)<\/li>\n<li>\u0437\u0443\u0440\u0433\u0438\u0439\u043d \u0442\u0430\u043b\u0430\u0430\u0440 \u0434\u044d\u043b\u0433\u044d\u0440\u04af\u04af\u043b\u044d\u043d \u0443\u043d\u0448!<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u041b\u043e\u0433\u0438\u043a \u04af\u0439\u043b\u0434\u043b\u04af\u04af\u0434<\/h2>\n<p>\u0417\u0430\u0440\u0438\u043c \u0442\u043e\u0445\u0438\u043e\u043b\u0434\u043e\u043b\u0434 \u0442\u043e\u043e\u043d\u0443\u0443\u0434\u044b\u0433 \u0445\u0430\u0440\u044c\u0446\u0443\u0443\u043b\u0430\u0445 \u0445\u044d\u0440\u044d\u0433\u0442\u044d\u0439 \u0431\u043e\u043b\u0434\u043e\u0433. \u042d\u043d\u044d \u0442\u043e\u0445\u0438\u043e\u043b\u0434\u043e\u043b\u0434 \u0431\u0438\u0434 \u043b\u043e\u0433\u0438\u043a \u04af\u0439\u043b\u0434\u043b\u0438\u0439\u0433 \u0430\u0448\u0438\u0433\u043b\u0430\u043d\u0430.<\/p>\n<h3>\u0422\u0443\u0440\u0448\u0438\u043b\u0442<\/h3>\n<p>\u0425\u0430\u0440\u044c\u0446\u0443\u0443\u043b\u0430\u0445 \u04af\u0439\u043b\u0434\u043b\u04af\u04af\u0434: ==, ~=, &lt; &gt;, &lt;=, &gt;=:<\/p>\n<p>&gt;&gt; 1==2<\/p>\n<p>&gt;&gt; 3~=5<\/p>\n<p>&gt;&gt; 5&lt;=6<\/p>\n<p>&gt;&gt; 7&lt;=10<\/p>\n<p>\u042d\u0434\u0433\u044d\u044d\u0440 \u04af\u0439\u043b\u0434\u043b\u04af\u04af\u0434 \u0431\u0443\u0440\u0443\u0443 \u04af\u0435\u0434 0 \u0437\u04e9\u0432 \u04af\u0435\u0434 1 \u0433\u044d\u0441\u044d\u043d \u0443\u0442\u0433\u0430 \u0431\u0443\u0446\u0430\u0430\u043d\u0430. \u04e8\u04e9\u0440\u04e9\u04e9\u0440 \u0445\u044d\u043b\u0431\u044d\u043b 0 \u0431\u043e\u043b false \u0431\u0443\u044e\u0443 \u0445\u0443\u0434\u0430\u043b 1 \u0431\u043e\u043b true \u0431\u0443\u044e\u0443 \u04af\u043d\u044d\u043d \u0433\u044d\u0441\u044d\u043d \u0441\u0430\u043d\u0430\u0430\u0433 \u0438\u043b\u0442\u0433\u044d\u043d\u044d.<\/p>\n<p>While this notation looks similar to math, there are a few pitfalls<\/p>\n<ul>\n<li>1&lt;x&lt;5\u00a0does NOT return what it does in math&#8230;in fact this will alway be true regardless of the value of x. Can you see why?<\/li>\n<li>==\u00a0is not\u00a0=. Regardless of how many time I will say this, people will still make this mistake many times&#8230;but perhaps by saying it lots, it will happen less&#8230;maybe. remember&#8230;you have been warned&#8230;= is assignment, and == is a test for equality.<\/li>\n<\/ul>\n<h3>Boolean operations<\/h3>\n<p>What if we want to check two things? A and B? or perhaps A and (B or C)&#8230;for this we need Boolean operators: &amp; (AND), | (OR), and ~(NOT)<\/p>\n<p>(The | is usually found at the middle right of the keyboard, and it needs a SHIFT key.)<\/p>\n<ul>\n<li>1~=2 | 3&lt;4<\/li>\n<li>3~=4 &amp; 8==(4+4)<\/li>\n<li>~(2&lt;=8)<\/li>\n<\/ul>\n<h2>Formatting Text<\/h2>\n<p>Once in a while we would like to display some text that is nicely formatted and not just the output as Matlab wants to display. To do this we use the\u00a0sprintf\u00a0command.<\/p>\n<p>In its simplest form it is quite straightforward&#8230;the first arguemnt is a format string, and the rest are parameters for the string. examples:<\/p>\n<ul>\n<li>sprintf(&#8216;hello, here is a number %d&#8217;,17)<\/li>\n<li>sprintf(&#8216;my name is %s and I am %g years old&#8217;,&#8217;Yossi&#8217;,31)<\/li>\n<\/ul>\n<p>Read up on\u00a0sprintf\u00a0to get the whole picture.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0425\u0438\u0447\u044d\u044d\u043b \u2116 3.<\/p>\n<p> \u041c\u0430\u0442\u0440\u0438\u0446\u044b\u043d \u0433\u0438\u043d\u0436\u0438\u043d \u0445\u043e\u043b\u0431\u043e\u043e <\/p>\n<p>\u0425\u0430\u0430\u043b\u0442\u044b\u0433 \u0430\u0448\u0438\u0433\u043b\u0430\u043d \u0438\u043b\u04af\u04af \u043d\u0438\u0439\u043b\u043c\u044d\u043b \u043c\u0430\u0442\u0440\u0438\u0446\u044b\u0433 \u04af\u04af\u0441\u0433\u044d\u0436 \u0431\u043e\u043b\u043d\u043e:<\/p>\n<p>&gt;&gt; [ones(2,2) zeros(2,2)]<\/p>\n<p>&gt;&gt; [ones(2,2) ; zeros(2,2)]<\/p>\n<p> \u0414\u0430\u0441\u0433\u0430\u043b \u042d\u0445\u043d\u0438\u0439 \u0431\u0430\u0433\u0430\u043d\u0430 \u043d\u044c 1:10 \u0433\u044d\u0441\u044d\u043d \u0442\u043e\u043e\u043d\u0443\u0443\u0434\u044b\u0433, \u0434\u0430\u0440\u0430\u0430\u0433\u0438\u0439\u043d \u0431\u0430\u0433\u0430\u043d\u0430 \u043d\u044c \u044d\u0445\u043d\u0438\u0439 \u0431\u0430\u0433\u0430\u043d\u044b\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u04af\u04af\u0434\u0438\u0439\u043d \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0443\u0442\u0433\u044b\u0433 \u0441\u04af\u04af\u043b\u0447\u0438\u0439\u043d \u0431\u0430\u0433\u0430\u043d\u0430 \u043d\u044c \u044d\u0445\u043d\u0438\u0439 \u0431\u0430\u0433\u0430\u043d\u044b\u043d \u0433\u0443\u0440\u0432\u0430\u043d \u0437\u044d\u0440\u044d\u0433\u0442\u0438\u0439\u0433 \u0430\u0433\u0443\u0443\u043b\u0441\u0430\u043d \u043c\u0430\u0442\u0440\u0438\u0446 \u04af\u04af\u0441\u0433\u044d. \u0418\u043b\u044d\u0440\u0445\u0438\u0439\u043b\u043b\u04af\u04af\u0434 <\/p>\n<p>\u0411\u04af\u0445 Matlab \u0438\u043b\u044d\u0440\u0445\u0438\u0439\u043b\u043b\u04af\u04af\u0434 \u0434\u0430\u0440\u0430\u0430\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u04af\u04af\u0434\u0438\u0439\u0433 \u04e9\u04e9\u0440\u0442\u04e9\u04e9 \u0430\u0433\u0443\u0443\u043b\u0441\u0430\u043d \u0431\u0430\u0439\u0434\u0430\u0433:<\/p>\n<p> <span style=\"color:#777\"> . . . &rarr; Read More: <a href=\"https:\/\/uranchimeg.com\/Education\/?p=3993\">MIT-\u043d MATLAB \u0445\u0438\u0447\u044d\u044d\u043b. \u2116 3<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[15,12,20],"tags":[47,68,65,55,24],"_links":{"self":[{"href":"https:\/\/uranchimeg.com\/Education\/index.php?rest_route=\/wp\/v2\/posts\/3993"}],"collection":[{"href":"https:\/\/uranchimeg.com\/Education\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/uranchimeg.com\/Education\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/uranchimeg.com\/Education\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/uranchimeg.com\/Education\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3993"}],"version-history":[{"count":0,"href":"https:\/\/uranchimeg.com\/Education\/index.php?rest_route=\/wp\/v2\/posts\/3993\/revisions"}],"wp:attachment":[{"href":"https:\/\/uranchimeg.com\/Education\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/uranchimeg.com\/Education\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/uranchimeg.com\/Education\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}