Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using matlab i need solutions fast variouputs.m TEST.mx + 1 function avarinouputs (varargin) S=0 for n=1: nargin if sum (size (varargin(n))) - 2 s=s+varargin(n); end

Using matlab i need solutions fast

image text in transcribed

variouputs.m TEST.mx + 1 function avarinouputs (varargin) S=0 for n=1: nargin if sum (size (varargin(n))) - 2 s=s+varargin(n); end end && vararginin) > 3 IIIIIIII disp ([nargin nargout]) | 1 10 error 6 0 Q1: Answer all of the following (1-10). 1. We can use help and doc commands/functions to get information on how to use a function in MATLAB. 2. MATLAB variable names must start with a letter 3. An example of a built-in variable in MATLAB is pior i 4. The result of the following command A=2*(3+2)/31-1 in MATLAB is: A 30 5- If B=5+6i, then B' and transpose(B) commands are the same. True or False? False 6- Let a=(2, 4, 6] and b=[5; 2; 6). Which of the following operations would not give an error? a) a+b; b, d, e and I b) a'-b; c) a.*b; d) b*a: e) a./b': f) a. a; 7- IfC=[1, 5, 6, 10, 3, 8], then C(1) C(end-2)= C(1.5) 8- If D-[1, 2, 3; 4, 5, 6; 7, 8, 9), then sub2ind([33], [3 2], [22]=_(56) D(2,3) D(end-2)= 9- The result of the following command E=0.1 b) evennumber-numel(A(mod(A.2)==0)); Q3: Define a 2-D array (matrix) "A" with a dimension of 5*4 and fill it with random integers in the range (5,30). Then: a) Multiply the odd numbers in the matrix A by 2, b) How many even numbers in the matrix A? c) Insert a row of ones after the first row of matrix A. Q4: Define a function, name it varinputs, that accepts variable number of inputs and returns the sum of the scalar elements that are greater than 3 and displays the number of input and output arguments set by the user. Q4 solution is at the top of this paper. tic toc toc

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions