MATLAB: RATS command effect: how to explain matlab core >> rats(0.3)-rats(0.2) ans = 0 0 0 0 0 0 2 0 -4 16 0 0 0 0 Best Answer rats() gives an output as string. So the ans you gave is a result of substraction of two strings.rats(0.3)= ' 3/10 'rats(0.2)= ' 1/5 ' Related SolutionsMATLAB: Add blank spaces in cell array ar = [0,1,0,0,0,0,0,0,0,0; ... 0,0,0,3,0,0,0,0,0,0; ... 0,0,0,0,0,0,2,0,0,0; ... 0,0,0,0,0,0,0,0,3,0; ... 4,0,0,0,0,0,0,0,0,0];fmt = repmat('%11d', 1, size(ar,2));% Either:C = sprintfc(fmt, ar); % Unfortunately not documented% Or:D = compose(fmt, ar) % Working since R2016b MATLAB: About function rats and how to output to .txt a1 = strtrim(rats(a/pi));Use strtrim() to remove leading and trailing white space. Related QuestionHow to import .dat dataBug in rounding functions? Who can explain? :)Delete rows and columns with zeros in a multi level cell array matrix.Create an echo effect
Best Answer