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.....
Knight's Tour Checker
Distance walked 1D
Find the sides of an isosceles triangle when given its area and height from its base to apex
Solve a System of Linear Equations
Selecting books on MATLAB for experts and beginners (blindfolded)
Mr. Pyramidad & Ms. Whissy Bolower
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