answer.
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
ZanzabumX [31]
2 years ago
6

Using basic programming (for loops, while loops, and if statements), write two MATLAB functions, both taking as input:

Computers and Technology
1 answer:
borishaifa [10]2 years ago
5 0

Answer:

For n = 100

  • (AB)x: 10100
  • A(Bx): 200

For n = 200

  • (AB)x: 40200
  • A(Bx): 400

For n = 400

  • (AB)x: 160400
  • A(Bx): 800

For n = 800

  • (AB)x: 640800
  • A(Bx): 1600

The faster approach is A(Bx)

Explanation step by step functions:

A(Bx) is faster because requires fewer interactions to find a result: for (AB)x you have (n*n)+n interactions while for A(Bx) you have n+n, to understand why please see the step by step:

a) Function for (AB)x:

function loopcount1 = FirstAB(A,B,x)  

 n = size(A)(1);

 AB = zeros(n,n);

 ABx = zeros(n,1);

 loopcount1 = 0;  

 for i = 1:n

   for j = 1:n

     AB(i,j) = A(i,:)*B(:,j);

     loopcount1 += 1;

   end

 end

 for k = 1:n

   ABx(k) = AB(k,:)*x;

   loopcount1 += 1;

 end

end

b) Function for A(Bx):

function loopcount2 = FirstBx(A,B,x)

 n = size(A)(1);

 Bx = zeros(n,1);

 ABx = zeros(n,1);

 loopcount2 = 0;  

 for i = 1:n

   Bx(i) = B(i,:)*x;

   loopcount2 += 1;

 end

 for j = 1:n

   ABx(j) = A(j,:)*Bx;

   loopcount2 += 1;

 end

end

You might be interested in
Choose the correct sequence for classifier building from the following.
Alekssandra [29.7K]

Answer:

b

Explanation:

First, we need to initialize the classifier.

Then, we are required to train the classifier.

The next step is to predict the target.

And finally, we need to evaluate the classifier model.

You will find different algorithms for solving the classification problem. Some of them are like  decision tree classification  etc.

However, you need to know how these classifier works.  And its explained before:

You need  to initialize the classifier at first.

All kinds of classifiers in the scikit-learn make use of the method fit(x,y) for fitting the model or the training for the given training set in level y.

The predict(x) returns the y which is the predicted label.And this is prediction.

For evaluating the classifier model- the score(x,y) gives back the certain score for a mentioned test data x as well as the test label y.

8 0
2 years ago
On the planet Sigma, robots excavate chunks of a very precious cristaline. These chunks can be divided into smaller part only on
Rainbow [258]

Answer:

Start the algorithm and check the weight of the ship. Load the crystalline to the ship. Check to see if the ship weighs ship weight + k pound crystalline, if less, add more crystalline. If excess, remove the excess crystalline, but if the weight meets the condition, then take off with the loaded ship to planet sigma.

Explanation:

The algorithm continuously checks the weight of the ship on loading with the calculated sum of the ship and k pound crystalline weight. The ship is able to load the correct maximum amount of crystalline to the planet sigma.

7 0
2 years ago
[20 points] 3.3 Code Practice: Question 2
igor_vitrenko [27]

Answer:

See explanation

Explanation:

The attachment show that you've attempted the question already.

I'll assist in making corrections to your source code.

First, edit line 5 to

if(r<= 255 and g<=255 and b <=255):

Then edit line 8 to:

if(r>= 255):

Then edit line 11 to:

if(g>= 255):

Lastly, edit line 14 to:

if(b>= 255):

<em>Other part of the attachment is correct</em>

3 0
2 years ago
in a blank excel workbook go to insert tab on the ribbon, which of the following is Not vailable 1 smart art 2 coloumns ( not co
Anuta_ua [19.1K]

Answer:

  1. hahahahahahahhahah
7 0
2 years ago
A network technician sets up an internal dns server for his local network. When he types in a url which is checked first
VLD [36.1K]

Answer:

The first thing that the browser checks is the cache for the DNS record to find the corresponding IP address.

Explanation:

After the technician sets up the internal DNS server for his local network, the first thing that is checked when he types a website into the url of a browser is the cache to look for corresponding IP addresses.

DNS which means Domain Name System is a database that maintains the website name (URL) and the IP address that it is linked to. There is a unique IP address for every URL (universal resource locator).

Internal DNS servers store names and IP addresses for internal or private servers

8 0
2 years ago
Other questions:
  • What are the two most important network-layer functions in a datagram network? what are the three most important network-layer f
    7·1 answer
  • Graphical elements that precede each item in a list are known as​ __________.
    8·1 answer
  • The main problem with radio transmission is which of the following? Select one: a. Radio waves cannot travel through walls. b. W
    9·2 answers
  • QUESTION 9 of 10: Bob charged $200 for a plane ticket last month. When he received his statement, he saw that he could pay the m
    12·2 answers
  • You have several pictures of different sizes that you would like to frame.A local picture framing store offers two types of fram
    15·1 answer
  • When using the following symbol, there are two arrows coming out of it. One arrow corresponds to what happens in the program if
    7·1 answer
  • An extranet is like an intranet except that it allows company employees access to corporate Web sites from the ______
    13·1 answer
  • What is an input to the Program Increment Planning process that highlights how Product Management plans to accomplish the Vision
    15·1 answer
  • Which of the following operation is not performed by a mouse 1) left click , middle click , right click, double click​
    15·2 answers
  • A series of gentle often open-ended inquiries that allow the client to progressively examine the assumptions and interpretations
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!