Skip to main content
Commonmark migration
Source Link

#MATLAB#

MATLAB

fprintf('%c.%c',num2str(int8(num2str(sum(2,2)))))

Ok, so not quite 2+2, but it does look like it does the sum of 2 with 2 to make 5.0. Now I will leave you to ponder quite how it ends up being 5.0 given ASCII and all.

:)

Just in case you are trying to work out how 50+2 equals '50', you should probably look up the documentation of sum. All is not quite what it seems ;)

#MATLAB#

fprintf('%c.%c',num2str(int8(num2str(sum(2,2)))))

Ok, so not quite 2+2, but it does look like it does the sum of 2 with 2 to make 5.0. Now I will leave you to ponder quite how it ends up being 5.0 given ASCII and all.

:)

Just in case you are trying to work out how 50+2 equals '50', you should probably look up the documentation of sum. All is not quite what it seems ;)

MATLAB

fprintf('%c.%c',num2str(int8(num2str(sum(2,2)))))

Ok, so not quite 2+2, but it does look like it does the sum of 2 with 2 to make 5.0. Now I will leave you to ponder quite how it ends up being 5.0 given ASCII and all.

:)

Just in case you are trying to work out how 50+2 equals '50', you should probably look up the documentation of sum. All is not quite what it seems ;)

added 26 characters in body
Source Link
Tom Carpenter
  • 4.3k
  • 13
  • 21

#MATLAB#

fprintf('%c.%c',num2str(int8(num2str(sum('2'2,2)))))

Ok, so not quite 2+2, but it does dolook like it does the sum of '2'2 with 2 to make 5.0. Now I will leave you to ponder quite how it ends up being 5.0 given ASCII and all.

:)

Just in case you are trying to work out how 50+2 equals '50', you should probably look up the documentation of sum. All is not quite what it seems ;)

#MATLAB#

fprintf('%c.%c',num2str(sum('2',2)))

Ok, so not quite 2+2, but it does do the sum of '2' with 2 to make 5.0. Now I will leave you to ponder quite how it ends up being 5.0 given ASCII and all.

:)

Just in case you are trying to work out how 50+2 equals '50', you should probably look up the documentation of sum. All is not quite what it seems ;)

#MATLAB#

fprintf('%c.%c',num2str(int8(num2str(sum(2,2)))))

Ok, so not quite 2+2, but it does look like it does the sum of 2 with 2 to make 5.0. Now I will leave you to ponder quite how it ends up being 5.0 given ASCII and all.

:)

Just in case you are trying to work out how 50+2 equals '50', you should probably look up the documentation of sum. All is not quite what it seems ;)

Source Link
Tom Carpenter
  • 4.3k
  • 13
  • 21

#MATLAB#

fprintf('%c.%c',num2str(sum('2',2)))

Ok, so not quite 2+2, but it does do the sum of '2' with 2 to make 5.0. Now I will leave you to ponder quite how it ends up being 5.0 given ASCII and all.

:)

Just in case you are trying to work out how 50+2 equals '50', you should probably look up the documentation of sum. All is not quite what it seems ;)