function z = mysub(x,y)
z = num2str( str2num(x) - str2num(y) );
why this is not working for this code?
Hi. My code only prints out '-' for a negative number but not '+' for a positive. Can anyone help? function Z = mysub(X,Y); W = (str2num(X))-(str2num(Y)); Z = num2str(W); end
actually each of them has 14 characters or less...15 if we count the signs.
Mark Sanderson, if W > 0 Z = ['+' ...]
piece of cake
string to double and sprintf
Need to calculate the difference ... not the sum! :)
Sorry for this...just had to try regexp. Somehow, the size of this is calculated completly wrong.....
Encode Roman Numerals
How many trades represent all the profit?
Free passes for everyone!
Extra safe primes
Given an unsigned integer x, find the largest y by rearranging the bits in x
Given a square and a circle, please decide whether the square covers more area.
area of an annulus
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office