function w = flip_it(v)
% Write a function called flip_it that has one input argument, a row vector v,
and one output
% argument, a row vector w that is of the same length as v. The vector w
contains all the elements of
% v, but in the exact opposite orde
function [ out ] = zero_stat( X )
% Write a function called zero_stat that takes a matrix as an input that only
has 0 and 1 elements.
% The function needs to compute and return the percentage of 0 elements in the
matrix. For
% example, if there are 10 zer
function [ out ] = sum3and5muls( n )
% If we list all the natural numbers up to 10t hat are multiples of 3 or 5, we
get 3, 5, 6, 9 and 10. The
% sum of these multiples is 33. Write a function called sum3and5muls that
returns the sum of all
% the unique mu
function [ income_week ] = income( rate,price )
%Write a function called income that takes two row vectors of the same length as
input arguments.
%The first vector, rate contains the number of various products a company
manufactures per hour
imultaneously
function X = top_right(N,n)
% Write a function called top_right that takes two inputs: a matrix N and a
scalar non-negative
% integer n, in that order, where each dimension of N is greater than or equal
to n. The function
% returns the n-by-n square array
function [area,cf]=circle(r)
% Write a function called circle that takes a scalar input r. It needs to return
an output called
% area that is the area of a circle with radius r and a second output, cf that
is the circumference of
% the same circle. You ar
function [ orms ] = odd_rms( nn )
% Write a function called odd_rms that returns orms, which is the square root of
the mean of the
% squares of the first nn positive odd integers, where nn is a positive integer
and is the only input
% argument. For exampl
function [ timeInMinutes, distanceInMiles ] = light_speed( distanceInKm )
% Write a function called light_speed that takes as input a row vector of
distances in kilometers
% and returns two row vectors of the same length. Each element of the first
output
function amag = accelerate( F1, F2, m )
%Write a function that is called like this: amag = accelerate(F1,F2,m). F1 and
F2 are
%three-element column vectors that represent two forces applied to a single
object. The argument m
%equals the mass of the object
function [ M ] = reverse_diag( n )
% Write a function called reverse_diag that creates a square matrix whose
elements are 0
% except for 1s on the reverse diagonal from top right to bottom left. The
reverse diagonal of an
% n- by-n matrix consists of the
function [ S ] = simple_stats( N )
% Write a function called simple_stats that takes a matrix N as an input and
returns the matrix S
% as the output. S has the same number of rows as N. Each element of the first
column of S contains
% the mean of the corr
function [ Q ] = intquad( n,m )
% Write a function called intquad that takes as its input arguments two scalar
positive integers
% named n and m in that order. The function returns Q, a 2n-by-2m matrix. Q
consists of four n-by-m
% submatrices. The element
function [M_out] = even_index(M)
% Write a function called even_index that takes a matrix, M, as input argument
and returns a
% matrix that contains only those elements of M that are in even rows and
columns. In other words, it
% would return the elements
function [ n_seg, n_poles ] = fence( lng, seg )
% Write a function called fence that takes two scalar inputs: lng, the length of
a straight fence we
% need to build and seg, the length of one segment of fencing material. A
segment needs to have a
% pole a
function [ Sum_A ] = peri_sum( A )
% Write a function called peri_sum that computes the sum of the elements of an
input matrix A
% that are on the ?perimeter? of A. In other words, it adds together the
elements that are in the first
% and last rows and co
function [sine,mean_sine]= sindeg( deg )
% Write a function called sindeg that takes a matrix input called deg. The
function returns a matrix
% of the same size as deg with each of its elements containing the sine of the
corresponding element
% of deg. No