Question

2. Cut and file with yower namme on the Sirst pae to Biacsbownd (holkdert Course . Upload the word file with ower o1. (25 pts

help with all but priority on last 2 questions

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB Code:

close all
clear
clc

fprintf('\nQ1\n----------------\n')
A = [35 1 6 26 19 24;
3 32 7 21 23 25;
31 9 2 22 27 20;
8 28 33 17 10 15;
30 5 34 12 14 16;
4 36 29 13 18 11];
min_element = min(min(A(end-2:end,:)))

fprintf('\nQ2\n----------------\n')
h = 1e-3;
x = 0:h:2;
y = sin(0.3*pi*x).^2;
plot(x,y), xlabel('x'), ylabel('y')
title('y = sin(0.3\pix)^2')
area_approx = sum(y)*h
area_actual = integral(@(x) sin(0.3*pi*x).^2, 0, 2)

fprintf('\nQ3\n----------------\n')
B = [16 2 3 13;
5 11 10 8;
9 7 6 12;
4 14 15 1];
num_elements = sum(sum(B <= 10 & B ~= 6))

fprintf('\nQ3\n----------------\n')
C = zeros(100);
l = 2;
for i=l+1:2*l:100
C(:,i:i+l-1) = 255;
end
imshow(C)

Output:


Q1
----------------
min_element =
4

Q2
----------------
area_approx =
1.1564
area_actual =
1.1559

Q3
----------------
num_elements =
9

Q4
----------------

Image (For Q4):

Add a comment
Know the answer?
Add Answer to:
2. Cut and file with yower namme on the Sirst pae to Biacsbownd (holkdert Course . Upload the wor...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 1 a. Define the following matrices in a script file (M-file), ? = ( 8...

    Question 1 a. Define the following matrices in a script file (M-file), ? = ( 8 9 10 11; 23 9 16 15 ;11 12 3 6; 1 2 8 9 ) ? = ( 2 21 7 15; 12 4 8 22; 23 9 5 13; 23 4 21 22) ℎ = (4 9 12 15) b. Add suitable lines of codes to the M-file to do the following. Each of the following points should be coded in only...

  • Problem 1: Use MATLAB to create a script file and publish a pdf file for the...

    Problem 1: Use MATLAB to create a script file and publish a pdf file for the problem: Given that MX = Y, for the following matrices determine X using both matrix inversion and Gaussian elimination methods 7 -2 4.67 5 7 6.5 -8 13 Y = 13 Display results in short engineering format. Submit the published pdf file. Problem 2: Use MATLAB to create a script file and publish a pdf file for the problem: Given that MX = Y,...

  • Problem 1: Use MATLAB to create a script file and publish a pdf file for the...

    Problem 1: Use MATLAB to create a script file and publish a pdf file for the problem: For x equal to 1.5 at intervals of 0.05 y = 6.25 +1.8 Create a rectangular plot of x&y. Submit the published pdf file. Problem 2: Use MATLAB to create a script file and publish a pdf file for the problem: Create a bar chart for Grade А B Students 48 37 29 2 6 D F Submit the published pdf file. Problem...

  • Therefore, for this program you will read the data in the file named weatherdata_2.txt into arrays...

    Therefore, for this program you will read the data in the file named weatherdata_2.txt into arrays for the wind speed and for the temperature. You will then use the stored data to calculate and output the average wind speed and the average temperature. Create a constant with a value of 30 and use that to declare and loop through your arrays and as a divisor to produce your averages. Here is the data file (below). 1. 14 25 2. 12...

  • 1. Write 4 simple shell scripts. Each question will ask you to write one or more...

    1. Write 4 simple shell scripts. Each question will ask you to write one or more command lines to solve a problem. Put the command(s) from each problem into a file named problem1.sh, problem2.sh Note that if you want your script to be interpreted by bash, each file should start with the line: #!/bin/bash and will have one (or more, as needed) commands following it. To execute each script in bash, so you can determine if it is working or...

  • Stdio.h format. Proper commenting please. Needs to be able to be saved as a .C file....

    Stdio.h format. Proper commenting please. Needs to be able to be saved as a .C file. Thanks in advance. Please do not copy and paste any of the other answers already on this site as they do not work. If you can't do it please don't answer my question. 1) A matrix M with i rows, j columns can be transposed into a matrix N having j rows and i columns by simply setting the value of Nob equal to...

  • Edit View History Bookmarks Window Help webassign.net Cengage m2302 u6 sec71 Cengage My Home Page Upload...

    Edit View History Bookmarks Window Help webassign.net Cengage m2302 u6 sec71 Cengage My Home Page Upload Assignment: Unit.. O-1 points SEssCalcET1 7.1.030. Sketch the region in the xy-plane defined by the inequalities x- 9y 2 0,1-x-8lyl 20 and find its area. Need Help? Read It Talk to a Tuter O1 points SEssCalcET1 7.1.032 Find the area of the region bounded by the parabola y 4x, the tangent line to this parabola at (2, 16), and the x-axis. Need Help? Read...

  • Consider the matrix: 15 9 13 2 6 10 14 3 7 11 15 4 8 12 16 a- Find the eigenvectors of this matri...

    Consider the matrix: 15 9 13 2 6 10 14 3 7 11 15 4 8 12 16 a- Find the eigenvectors of this matrix and their corresponding eigenvalues. b-Indicate if there are any degeneracy, and if so, change only one element of this matrix to remove this degeneracy (of course you need to recompute the eigenvalues to show that the degeneracy was lifted). Write a Mathematica program to calculate the roots of the following function f(x) = 0.5*e*-5*x+2 using...

  • Question 17 (2 points) Let A be a 3 x 4 matrix with a column space...

    Question 17 (2 points) Let A be a 3 x 4 matrix with a column space of dimension 2. What is the dimension of the row space of A? Not enough information has been given. O 1/2 3 2. Question 16 (2 points) The rank of the matrix 1 2 - 1 2 4 2 1 2 3 is 02 O none of the given options Question 15 (2 points) Which of the following is not a vector space because...

  • Java Magic Square: A n x n matrix that is filled with the numbers 1, 2,...

    Java Magic Square: A n x n matrix that is filled with the numbers 1, 2, 3,.... n^2 is a magic square if the sum of the elements in each row, in each column, and in the two diagonals is the same value. I need to write an application that gets 16 values as user input, in any order. Store these values in an ArrayList. When the numbers are put into a square, this would be a 4x4 two-dimensional array....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT