You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: region.m
    path of file: ./repos/malini/Codes/deconvolution - model/spm8/marsbar-0.44/@marsy
    
    the code of the file until where you have to start completion: function [rs,r_nos] = region(o, r_nos, new_data, fieldname)

    
function [rs,r_nos] = region(o, r_nos, new_data, fieldname)
% gets / sets data for region or regions 
% FORMAT [rs r_nos] = region(o, r_nos) (set) OR
% FORMAT [rs r_nos]= region(o, r_nos, new_data, fieldname) (get)
% 
% Inputs
% o              - marsy object
% r_nos          - region number 
%                  or array of region numbers
%                  or empty - giving all regions
% new_data       - cell array containing new data to set for region
% fieldname      - optional string, to identify field to be set
%                  using data in new_data
%   
% Returns
% (get call)
% rs             - cell array of region structures
% (set_call)
% rs             - new marsy object with fields set
%   
% r_nos          - region nos (empty now -> all region nos)
% 
% $Id$

r = n_regions(o);
if nargin < 2
  r_nos = [];
end