1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Gre4nikov [31]
3 years ago
12

The magic square is an arrangement of numbers in a square grid in such a way that the sum of the numbers in each row, and in eac

h column, and in each diagonal is the same. MATLAB has a built-in function _magic(n) that returns an n times n magic square. In a script file create a (5 times 5) magic square, and then test the properties of the resulting matrix by finding the sum of the elements in each row, in each column and in both diagonals. In each case, use MATLAB's built-in function _sum. (Other functions that can be useful are diag and fliplr.)
Engineering
1 answer:
Yuki888 [10]3 years ago
3 0

Answer:

See the explanation for the answer;

Explanation:

Matlab code is as given below

-------------------------------------------------------------------------------------Start of code

% Program to create a magic square and verify it

clc

M= magic(5)

% To find sum of elements of each row

r1= sum(M(1,:))      % Sum of row 1

r2= sum(M(2,:))      % Sum of row 2

r3= sum(M(3,:))      % Sum of row 3

r4= sum(M(4,:))      % Sum of row 4

r5= sum(M(5,:))      % Sum of row 5

% To find sum of each coloumn

c1= sum(M(:,1))      % Sum of coloumn 1

c2= sum(M(:,2))      % Sum of coloumn 2

c2= sum(M(:,3))      % Sum of coloumn 3

c2= sum(M(:,4))      % Sum of coloumn 4

c2= sum(M(:,5))      % Sum of coloumn 5

% To find sum of diagonal

d1= sum(diag(M))               % Sum of principal diagonal elements

d2= sum(diag(fliplr(M)))      

-------------------------------------------------------------------------------End of code

Following results are obtained when executed.

M =

   17    24     1     8    15

   23     5     7    14    16

    4     6    13    20    22

   10    12    19    21     3

   11    18    25     2     9

r1 =

   65

r2 =

   65

r3 =

   65

r4 =

   65

r5 =

   65

c1 =

   65

c2 =

   65

c2 =

   65

c2 =

   65

c2 =

   65

d1 =

   65

d2 =

   65

You might be interested in
A welding rod with κ = 30 (Btu/hr)/(ft ⋅ °F) is 20 cm long and has a diameter of 4 mm. The two ends of the rod are held at 500 °
SOVA2 [1]

Answer:

In Btu:

Q=0.001390 Btu.

In Joule:

Q=1.467 J

Part B:

Temperature at midpoint=274.866 C

Explanation:

Thermal Conductivity=k=30  (Btu/hr)/(ft ⋅ °F)= \frac{30}{3600} (Btu/s)/(ft.F)=8.33*10^{-3}  (Btu/s)/(ft.F)

Thermal Conductivity is SI units:

k=30(Btu/hr)/(ft.F) * \frac{1055.06}{3600*0.3048*0.556} \\k=51.88 W/m.K

Length=20 cm=0.2 m= (20*0.0328) ft=0.656 ft

Radius=4/2=2 mm =0.002 m=(0.002*3.28)ft=0.00656 ft

T_1=500 C=932 F

T_2=50 C= 122 F

Part A:

In Joules (J)

A=\pi *r^2\\A=\pi *(0.002)^2\\A=0.00001256 m^2

Heat Q is:

Q=\frac{k*A*(T_1-T_2)}{L} \\Q=\frac{51.88*0.000012566*(500-50}{0.2}\\ Q=1.467 J

In Btu:

A=\pi *r^2\\A=\pi *(0.00656)^2\\A=0.00013519 m^2

Heat Q is:

Q=\frac{k*A*(T_1-T_2)}{L} \\Q=\frac{8.33*10^{-3}*0.00013519*(932-122}{0.656}\\ Q=0.001390 Btu

PArt B:

At midpoint Length=L/2=0.1 m

Q=\frac{k*A*(T_1-T_2)}{L}

On rearranging:

T_2=T_1-\frac{Q*L}{KA}

T_2=500-\frac{1.467*0.1}{51.88*0.00001256} \\T_2=274.866\ C

4 0
3 years ago
Explain the difference between the connection of a cumulative compound and a differential compound motor
Alexandra [31]

Answer:

Explanation:

A motor is a device that directs current in electrical energy form to mechanical energy, which is known as direct current (DC) motors.

DC motors are of three types: (a) The series motor, (b) The shunt motor, and (c) the compound motor. Our main focus here is the Compound motor, which is further sub-divided into:

i) The cumulative compound motors

ii) The differential compound motors

The difference between these two are:

Cumulative compound motors                  Differential compound motors

In cumulative compound motors,              In differential compound motors,

both the series and shunt windings          both series and shunt are

are connected in a way that,                     connected in a way that the

production of fluxes through them           production of fluxes via them

assist each other i.e. they aid each          always opposes each other i.e.

other in the production of magnetism      they oppose each other in the

                                                                    production of magnetism.

6 0
3 years ago
A glass plate is subjected to a tensile stress of 40 MPa. If the specific surface energy is 0.3 J/m2 and the modulus of elastici
Alika [10]

Answer:

The maximum length of a surface flaw is 8.24 μm

8.24 μm

Explanation:

Given that:

The modulus of elasticity E = 69 GPa

The specific surface energy \delta_s = 0.3 J/m²

The length of the surface flaw "a" = ??

From the theory of the brittle fracture;

\sigma _c = \bigg (  \dfrac{2E \delta_s}{\pi a}  \bigg )^{1/2}

Making a the subject of the formula; we have:

a = \bigg (  \dfrac{2 \times E \times \delta_s}{\pi \sigma _c ^2}  \bigg )

a= \bigg (  \dfrac{2 \times 69*10^9 \times 0.3}{\pi (40*10^6)^2}  \bigg )

a = 8.24 × 10⁻⁶ m

a = 8.24 μm

Thus; the maximum length of a surface flaw is 8.24 μm

3 0
3 years ago
Write a SELECT statement that returns these four columns:
labwork [276]

A SELECT command pulls zero or more rows from one or more database tables or views. SELECT is the most often used data manipulation language (DML) command in most applications. See the statement required below.

<h3>What is the SELECT Statement that gives the above results?</h3>

SELECT VendorName, InvoiceNumber, InvoiceDate,

InvoiceTotal - PaymentTotal - CreditTotal AS Balance

FROM Vendors JOIN Invoices

ON Vendors.VendorID = Invoices.VendorID

WHERE InvoiceTotal - PaymentTotal - CreditTotal > 0

ORDER BY VendorName;

Learn more about SELECT Statements at;

brainly.com/question/19338967
#SPJ1

3 0
2 years ago
g Design of a spindle present in an existing design needs to be reviewed for use under new loading needs. It is currently design
ss7ja [257]

Answer: its c

Explanation:

6 0
3 years ago
Other questions:
  • Determine the required dimensions of a column with a square cross section to carry an axial compressive load of 6500 lb if its l
    13·2 answers
  • What precautions should you take to prevent injuries when dealing with heavy loads?
    6·2 answers
  • g At this party, is the fact that a person is from South America independent of that person being majoring in biomedical enginee
    11·1 answer
  • You are tasked to specify the flash storage device in General Electric's Data Logger Unit used in the smart power grid. The DLU
    12·1 answer
  • A turntable A is built into a stage for use in a theatrical production. It is observed during a rehearsal that a trunk B starts
    5·1 answer
  • SEICUL UC CULTELL allsvel.
    9·2 answers
  • Does it jiggle? Does it really jiggle jiggle?
    9·2 answers
  • An insulated 40 ft^3 rigid tank contains air at 50 psia and 580°R. A valve connected to the tank is now opened, and air is allow
    10·1 answer
  • What is the need to achieve population inversion​
    7·1 answer
  • on the same scale for stress, the tensile true stress-true strain curve is higher than the engineeringstress-engineering strain
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!