yalmip / YALMIP

MATLAB toolbox for optimization modeling
https://yalmip.github.io/
Other
479 stars 137 forks source link

Update isVersionRecent.m #1242

Closed htadashi closed 1 year ago

htadashi commented 1 year ago

Fixes #1241

johanlofberg commented 1 year ago

Are you saying Chat-GPT isn't perfect?

htadashi commented 1 year ago

ChatGPT is very good, but it pales in comparison to your skills, @johanlofberg :)

johanlofberg commented 1 year ago

Out of curiosity, I added the prompt "it should work also when both arguments only have two numbers" and Chat-GPT adhered and added the lines

% Assume missing third component is zero
    if numel(version1Arr) < 3
        version1Arr(3) = 0;
    end
    if numel(version2Arr) < 3
        version2Arr(3) = 0;
    end

Almost exactly your addition, albeit slightly more compact as it skips the redundant use of the end-operator.

htadashi commented 1 year ago

Very interesting! I've read a recent article in Quanta Magazine about LLMs and it seems that a good prompt engineering can really leverage the power of these models.