`Hey,
Note: If you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
clc
clear all
close all
format long
disp('Q6');
C=[1,1,1;1,0,1;1,1,1]
disp('linear index is');
ind=find(C==0)
disp('Subscrript is');
[r,c]=ind2sub([3,3],ind)
disp('Q7')
D=[0,0,0;0,0,0;0,0,2]
disp('smallest element is');
min(min(D))
disp('linear indexes are');
find(D==min(min(D)))
disp('Q8');
x=1:10;
y=3*sin(x+2)+1
Kindly revert for any queries
Thanks.
PLEASE USE MATLAB Create a single MatLab script that On a single line (Line 1), defines matrix A such that A = 1 2 4. 5 7 8 Suppress the echo of A. On a single line (Line 2), use the size function to echo the size of A. On a single line (Line 3), use the length function to echo the length of the entire first row of A. On a single line (Line 4), use linear index notation...
Exercise 1: Use Matlab command to obtain the following a) Extract the fourth row of the matrix generated by magic(6) b) Show the results of 'x' multiply by 'y' and 'y' divides by 'x'. Given x = [0:0.1:1.1] and y=[10:21] c) Generate random matrix 'r' of size 4 by 5 with number varying between -8 and 9 Exercise 2: Use MATLAB commands to get exactly as the figure shown below x=pi/2:pi/10:2*pi; y=sin(x); z=cos (x);
X=0 x = 1/2 x= L u U2 Uz (a) Trial solution for a 1-D quadratic elastic bar element can be written as follows: ū(x) = [N]{u} where, [N] = [N1 N2 N3] and {u} u2 13 1 and Ni L2 L2 [N] and {u} are known as interpolation function matrix and nodal displacement, respectively. (272 – 3L + L´), N= = (22- La), Ns = 12 (2=– LE) Derive the expression for element stiffness matrix, (Kelem) and element force...
help with all but priority on last 2 questions 2. Cut and file with yower namme on the Sirst pae to Biacsbownd (holkdert Course . Upload the word file with ower o1. (25 pts) Matrix A (6x6) is defined as 35 1 6 26 19 24 3 32 7 21 23 25 31 9 2 22 27 20 8 28 33 17 10 15 0 534 12 14 16 4)36 29 13 18 11 Write a script to find the...
1 A= 11 3 0 0 0 0 0 0 0 0 1 LO 0 0 0 ro 0 0 LO 1 1 0] 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 LO 0 0 C = 11 0 0 0 Which of the matrices below is the reduced row echelon matrix A. Matrix A and B B. Matrix A and C C. Matrix B and C D. All matrices...
Using hand work for the parts with a paper next to them, and MatLab for the parts with the MatLab logo next to them, complete the following: Consider the linear BVP 4y " + 3y , + y = 0, 0<x<1 y(0)1 You will define a set of linear equations for yi,0, (yi y(Xi), 1 = o,.. . ,n) and the set of nodes is with xi-ih, 1-0, . . . , n and h =-. n is a fixed...
1. In MATLAB on your computer (preferably) or on a workstation, Let x = [3456] a) Add 10 to each element ofx. Note that you can add a number to a matrix or vector b) Add 3 to odd-index elements ofx (keep using the original x [3 4 5 6] for each step) c) Compute the square of each element of x
You have the matrix below: a) 9 10 11 12 What will be displayed by the code: A(2:3,2:3) What will be displayed when you run the code below? b) a-0 while a<10 aa+3: end disp (a) d) Give the steps to find the roots of the following linear equation using MATLAB. rs + 2x4-5x3 + 7x2 + 12x + 20 = 0 a) Give MATLAB commands to plot, on the same figure, the two functions: f(t) = 3t2 +2t-0.5 g(c)-2t...
1. Write a MATLAB function that takes a matrix, a row number and a scalar as arguments and multiplies each element of the row of the matrix by the scalar returning the updated matrix. 2. Write a MATLAB function that takes a matrix, two row numbers and a scalar as arguments and returns a matrix with a linear combination of the rows. For example, if the rows passed to the function were i and j and the scalar was m,...
Compute the following problems using Math Lab. Instructions: Answer All Questions using MATLAB commands. Question 1. Create a vector of the even whole numbers between 31 and 75. Question 2. Let x [2516] a. Add 16 to each element b. Add 3 to just the odd-index elcments c. Compute the square root of each element d. Compute the square of each element Question 3. Let x 13 268T and y [4 1 3 5] (NB. x and y should be...