saimun1

01. Matlab functions Input Ouput

Aug 13th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.26 KB | None | 0 0
  1. function [a,s]= myRand(low, high) % a, s - output arguments, which are replaced by 'y' and 'S'
  2. % low, high - input arguments
  3. a=low+rand(low,high)*(high-low);
  4. v = a(:);
  5. s = sum(v);
  6. end
  7.  
  8. ----------------------CONSOLE------------------------
  9. [y S] = myRand(1,3)
Advertisement
Add Comment
Please, Sign In to add comment