Num2str变数值为字符串Int2str变整数为字符串Str2num变字符串为数值Sprintf变数值为格式控制下的字符串Sscanf变字符串为格式控制下的数值1.分段函数for x=-pi*6:pi/10:6*pi y=sin(x);if y0 y=0;endfprintf(x=%f,y=%fn,x,y);end2计算距离x1=input(enter the x1: );y1=input(enter the y1: );x2=input(enter the x2: );y2=input(enter the y2: );d=sqrt(x1-x2).2+(y1-y2).2);fprintf(the distance of the two points is :%f,d);v0=input(Enter the 初速度v0:);h0=input(Enter the 离地高度h0:);t=0:0.01:53重力加速度