%% Save Specific Variables to MAT-File
% Create and save two variables, p and q, to a file called pqfile.mat.

p = rand(1,10);
q = ones(10);
save('pqfile.mat','p','q')

% MATLAB® saves the variables to the file, pqfile.mat, in the current folder.
%
% You also can use command syntax to save the variables, p and q.

save pqfile.mat p q

% Copyright 2015 The MathWorks, Inc.