2Title Subtitle Subtle En ing Heading Paragraph Styles MATLAB PROGRAM 1. Create
ID: 3751044 • Letter: 2
Question
2Title Subtitle Subtle En ing Heading Paragraph Styles MATLAB PROGRAM 1. Create a variable a that is a row vector with the following elements: 9, 1,32, 7/4, o, 2.25 ×85.08, and sin(r/8). 3. Create a variable c that is a column vector with the following elements: 2.1 102, sin(.7a), 28.5, 2.7/3, ande. Create a variable h that is a row vector with eight equally spaced elements in which the first element is 68 and the last element is 12. 12. Using the linspace command, create a row vector (assign it to a variable named Fours) with nine elements that are all 4. 26. Create the following matrix by typing one command. Do not type individ- ual elements explicitly. 30. Create the following matrix by typing one command. Do not type individ- ual elements explicitlyExplanation / Answer
% ques 1
% sin() gives the value of sine()
a = [ 9 , 1 , 3 ^ 2 , 7 / 4 , 2.25 * 0.8 , sin( pi / 8 ) ]
% ques 3
c = [ 2.1 * ( 10 ^ -2 );
sin( 1.7 * pi ) ;
28.5 ;
2.7 ^ ( 4 / 3 );
exp(3)]
% create 8 equally spaced element between 68 and 12
h = linspace( 68 , 12 , 8 )
% ques 12
Fours = [ 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4]
% ques 26
% ' is used to transpose the matrix
% repelem() is used to make vector of size 5 and each eleemnt 6 and 8
c1 = [ repelem( [ 6 ] , 5 );
repelem( [ 8 ] , 5 ) ]'
G = [ repelem( [ 1 , 0 ] , 3 );
repelem( [ 1 , 0 ] , 3 );
repelem( [ 1 , 0 ] , 3 );
repelem( [ 1 ] , 6 );
repelem( [ 1 ] , 6 )]'
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.