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.....
Basic electricity in a dry situation
Number of Horns on a unicorn!
02 - Vector Variables 5
Matlab Basics - Convert a row vector to a column vector
Matlab Basics II - squares
Given an unsigned integer x, find the largest y by rearranging the bits in x
Person of interest?
Surface Fit z(x,y)
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