{"id":133,"date":"2024-03-26T11:29:58","date_gmt":"2024-03-26T10:29:58","guid":{"rendered":"https:\/\/logbooks.ifosim.org\/oscar\/?p=133"},"modified":"2024-03-26T11:30:42","modified_gmt":"2024-03-26T10:30:42","slug":"trying-the-ai-code-generator-for-matlab","status":"publish","type":"post","link":"https:\/\/logbooks.ifosim.org\/oscar\/2024\/03\/26\/trying-the-ai-code-generator-for-matlab\/","title":{"rendered":"Trying the AI code generator for Matlab"},"content":{"rendered":"\n<p>Something to try, the official AI for Matlab: <a href=\"https:\/\/fr.mathworks.com\/matlabcentral\/playground\/new\" data-type=\"link\" data-id=\"https:\/\/fr.mathworks.com\/matlabcentral\/playground\/new\">website<\/a> (I expect it must require a free MathWorks account)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"561\" src=\"https:\/\/logbooks.ifosim.org\/oscar\/wp-content\/uploads\/sites\/6\/2024\/03\/image-1024x561.png\" alt=\"\" class=\"wp-image-134\" srcset=\"https:\/\/logbooks.ifosim.org\/oscar\/wp-content\/uploads\/sites\/6\/2024\/03\/image-1024x561.png 1024w, https:\/\/logbooks.ifosim.org\/oscar\/wp-content\/uploads\/sites\/6\/2024\/03\/image-300x164.png 300w, https:\/\/logbooks.ifosim.org\/oscar\/wp-content\/uploads\/sites\/6\/2024\/03\/image-768x421.png 768w, https:\/\/logbooks.ifosim.org\/oscar\/wp-content\/uploads\/sites\/6\/2024\/03\/image.png 1450w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Screenshot of the AI interface<\/figcaption><\/figure>\n\n\n\n<p>The generated code is not bad, some explanations are even added. Here for some simple examples, with the prompt on top:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% Display all the prime numbers between 100 and 200\n\nlower_limit = 100;\nupper_limit = 200;\n\nprime_numbers = &#091;];\n\nfor num = lower_limit:upper_limit\n    if isprime(num)\n        prime_numbers = &#091;prime_numbers, num];\n    end\nend\n\nprime_numbers\n\n% The code is correct but quite lazy (which is positive)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>% Draw a circle of diameter 2 with the center at x = -1 and y = 0.5\n\ndiameter = 2;\ncenter_x = -1;\ncenter_y = 0.5;\n\nradius = diameter \/ 2;\n\nfigure;\nrectangle('Position', &#091;center_x - radius, center_y - radius, diameter, diameter], 'Curvature', &#091;1 1]);\naxis equal;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"653\" height=\"489\" src=\"https:\/\/logbooks.ifosim.org\/oscar\/wp-content\/uploads\/sites\/6\/2024\/03\/image-1.png\" alt=\"\" class=\"wp-image-137\" style=\"width:840px;height:auto\" srcset=\"https:\/\/logbooks.ifosim.org\/oscar\/wp-content\/uploads\/sites\/6\/2024\/03\/image-1.png 653w, https:\/\/logbooks.ifosim.org\/oscar\/wp-content\/uploads\/sites\/6\/2024\/03\/image-1-300x225.png 300w\" sizes=\"auto, (max-width: 653px) 100vw, 653px\" \/><figcaption class=\"wp-element-caption\">The circle drawned, yes it seems correct.<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Something to try, the official AI for Matlab: website (I expect it must require a free MathWorks account) The generated code is not bad, some explanations are even added. Here for some simple examples, with the prompt on top:<\/p>\n","protected":false},"author":67,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ssl_alp_hide_revisions":false,"footnotes":"","ssl_alp_hide_crossreferences_to":false},"categories":[87],"tags":[48],"ssl-alp-inventory-item":[],"ssl-alp-coauthor":[12],"class_list":["post-133","post","type-post","status-publish","format-standard","hentry","category-for-fun","tag-dissemination","ssl-alp-unread-flag-ssl-alp-unread-flag-aaron-jonesligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-agreennikhef-nl","ssl-alp-unread-flag-ssl-alp-unread-flag-alexander-adamligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-andreas-freiseligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-anna-greenligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-antoine-amyligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-bas-swinkelsligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-camilla-derossiligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-catalina-ana-miritesculigo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-daniela-pascucciligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-davidgnikhef-nl","ssl-alp-unread-flag-ssl-alp-unread-flag-eleonora-capocasaligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-enzo-tapialigo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-hiro-yamamotoligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-jacques-dingligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-jonathan-perryligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-jperrynikhef-nl","ssl-alp-unread-flag-ssl-alp-unread-flag-kevin-kunsligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-maddalena-mantovaniligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-michele-valentiniligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-mischa-salleligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-mkolknikhef-nl","ssl-alp-unread-flag-ssl-alp-unread-flag-monica-seglar-arroyoligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-mvalentinikhef-nl","ssl-alp-unread-flag-ssl-alp-unread-flag-p70081609unimaas-nl","ssl-alp-unread-flag-ssl-alp-unread-flag-paul-stevensligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-paulvalentin-hapkeligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-riccardo-maggioreligo-org","ssl-alp-unread-flag-ssl-alp-unread-flag-sebastslnikhef-nl","ssl-alp-unread-flag-ssl-alp-unread-flag-stopic","ssl-alp-unread-flag-ssl-alp-unread-flag-tschoonnikhef-nl","ssl-alp-unread-flag-ssl-alp-unread-flag-yuefangnikhef-nl","ssl-alp-unread-flag-ssl-alp-unread-flag-yuhang-zhao1ligo-org"],"_links":{"self":[{"href":"https:\/\/logbooks.ifosim.org\/oscar\/wp-json\/wp\/v2\/posts\/133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/logbooks.ifosim.org\/oscar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/logbooks.ifosim.org\/oscar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/oscar\/wp-json\/wp\/v2\/users\/67"}],"replies":[{"embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/oscar\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":5,"href":"https:\/\/logbooks.ifosim.org\/oscar\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":140,"href":"https:\/\/logbooks.ifosim.org\/oscar\/wp-json\/wp\/v2\/posts\/133\/revisions\/140"}],"wp:attachment":[{"href":"https:\/\/logbooks.ifosim.org\/oscar\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/oscar\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/oscar\/wp-json\/wp\/v2\/tags?post=133"},{"taxonomy":"ssl-alp-inventory-item","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/oscar\/wp-json\/wp\/v2\/ssl-alp-inventory-item?post=133"},{"taxonomy":"ssl-alp-coauthor","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/oscar\/wp-json\/wp\/v2\/ssl-alp-coauthor?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}