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
Karo-lina-s [1.5K]
3 years ago
6

Column arrays: Transpose a row array Construct a row array countValues with elements 1 to endValue, using the double colon opera

tor. Transpose countValues to result in a column array. Function Save Reset MATLAB DocumentationOpens in new tab function countValues = CreateArray(endValue) % endValue: Ending value of countValues % Construct a row array countValues with elements 1 to endValue, % using the double colon operator countValues = 1; % Transpose countValues to result in a column array end 1 2 3 4 5 6 7 8 9 10 11 Code to call your function

Engineering
1 answer:
White raven [17]3 years ago
7 0

Answer:

Matlab code with step by step explanation and output results are given below

Explanation:

We have to construct a Matlab function that creates a row vector "countValues" with elements 1 to endValue. That means it starts from 1 and ends at the value provided by the user (endValue).  

function countValues = CreateArray(endValue)

% Here we construct a row vector countValues from 1:endValue

     countValues = 1:endValue;

% then we transpose this row vector into column vector

     countValues = countValues';

 end

Output:

Calling this function with the endValue=11 returns following output

CreateArray(11)

ans =

    1

    2

    3

    4

    5

    6

    7

    8

    9

   10

   11

Hence the function works correctly. It creates a row vector then transposes it and makes it a column vector.

You might be interested in
How may a Professional Engineer provide notice of licensure to clients?
azamat

Find full question attached

Answer:

(b) By including a statement that he or she is licensed by the Board for Professional Engineers and Land Surveyors immediately above the signature line in at least 12 point type on all contracts for services

Explanation:

A PE(professional engineer) licensee must show that he is licensed in order to show and ensure public safety as he is qualified for the job he is handling. The California regulations on professional engineers holds that all professional engineers must be licensed by the board of professional engineers and Land surveyors in order to operate legally as an engineer. The engineer may show licensure through the following options:

The engineer might provide statement to each client to show he is licensed which would then be signed by the client

The engineer may choose to post a wall certificate in his work premises to show he is licensed

The engineer may choose to include a statement of license in a letterhead or contract document which must be above the client's signature line and not less than 12 point type

4 0
3 years ago
What is an air mass?​
kotegsom [21]

Answer:

An air mass is a body of air with horizontally uniform temperature, humidity, and pressure.

Explanation:

Because it is

8 0
3 years ago
Read 2 more answers
How wold you classify the earliest examples of S.T.E.M discoveries provided in this lesson?
Gnoma [55]

Answer:

the answer is C

Explanation:

8 0
3 years ago
Along with refining craft skills another way to increase the odds for career advancement is to
Xelga [282]

The acquisition of additional certifications with a personal refined craft skills can increase the odds for career advancemen.

<h3>What is a career advancement?</h3>

An advancement is achieved in a career if a professional use their skill sets, determination or perserverance to achieve new career height.

An example of a career advancement is when an employee progresses from entry-level position to management and transits from an occupation to another.

Therefore, the Option A is correct.

Read more about career advancement

<em>brainly.com/question/7053706</em>

7 0
2 years ago
computer language C++ (Connect 4 game)( this is all the info that was givin no input or solution) I used the most recent version
Mariana [72]

Answer:

C++ code explained below

Explanation:

#include "hw6.h"

//---------------------------------------------------

// Constructor function

//---------------------------------------------------

Connect4::Connect4()

{

ClearBoard();

}

//---------------------------------------------------

// Destructor function

//---------------------------------------------------

Connect4::~Connect4()

{

// Intentionally empty

}

//---------------------------------------------------

// Clear the Connect4 board

//---------------------------------------------------

void Connect4::ClearBoard()

{

// Initialize Connect4 board

for (int c = 0; c < COLS; c++)

for (int r = 0; r < ROWS; r++)

board[r][c] = ' ';

// Initialize column counters

for (int c = 0; c < COLS; c++)

count[c] = 0;

}

//---------------------------------------------------

// Add player's piece to specified column in board

//---------------------------------------------------

bool Connect4::MakeMove(int col, char player)

{

// Error checking

if ((col < 0) || (col >= COLS) || (count[col] >= ROWS))

return false;

// Make move

int row = count[col];

board[row][col] = player;

count[col]++;

return true;

}

//---------------------------------------------------

// Check to see if player has won the game

//---------------------------------------------------

bool Connect4::CheckWin(char player)

{

// Loop over all starting positions

for (int c = 0; c < COLS; c++)

for (int r = 0; r < ROWS; r++)

if (board[r][c] == player)

{

// Check row

int count = 0;

for (int d = 0; d < WIN; d++)

if ((r+d < ROWS) &&

(board[r+d][c] == player)) count++;

if (count == WIN) return true;

 

// Check column

count = 0;

for (int d = 0; d < WIN; d++)

if ((c+d < COLS) &&

(board[r][c+d] == player)) count++;

if (count == WIN) return true;

 

// Check first diagonal

count = 0;

for (int d = 0; d < WIN; d++)

if ((r+d < ROWS) && (c+d < COLS) &&

(board[r+d][c+d] == player)) count++;

if (count == WIN) return true;

 

// Check second diagonal

count = 0;

for (int d = 0; d < WIN; d++)

if ((r-d >= 0) && (c+d < COLS) &&

(board[r-d][c+d] == player)) count++;

if (count == WIN) return true;

}

return false;

}

//---------------------------------------------------

// Print the Connect4 board

//---------------------------------------------------

void Connect4::PrintBoard()

{

// Print the Connect4 board

for (int r = ROWS-1; r >= 0; r--)

{

// Draw dashed line

cout << "+";

for (int c = 0; c < COLS; c++)

cout << "---+";

cout << "\n";

// Draw board contents

cout << "| ";

for (int c = 0; c < COLS; c++)

cout << board[r][c] << " | ";

cout << "\n";

}

// Draw dashed line

cout << "+";

for (int c = 0; c < COLS; c++)

cout << "---+";

cout << "\n";

// Draw column numbers

cout << " ";

for (int c = 0; c < COLS; c++)

cout << c << " ";

cout << "\n\n";

}

//---------------------------------------------------

// Main program to play Connect4 game

//---------------------------------------------------

int main()

{

  int choice;

  int counter = 0;

  srand (time(NULL));

  Connect4 board;

  cout << "Welcome to Connect 4!" << endl << "Your Pieces will be labeled 'H' for human. While the computer's will be labeled 'C'" << endl;

  board.PrintBoard();

  cout << "Where would you like to make your first move? (0-6)";

  cin >> choice;

  while (board.MakeMove(choice,'H') == false){

  cin >> choice;

  }

  counter++;

  while (board.CheckWin('C') == false && board.CheckWin('H') == false && counter != 21){

  while (board.MakeMove(rand() % 7, 'C') == false){}

  board.PrintBoard();

  cout << "Where would you like to make your next move?" << endl;

  cin >> choice;

  board.MakeMove(choice,'H');

  while (board.MakeMove(choice,'H') == false){

  cin >> choice;

  }

  counter++;

  }

 

  if (board.CheckWin('C')){

  cout << "Computer Wins!" << endl;}

  else if (counter == 21){cout << "Tie Game!" << endl;}

  else {cout << "Human Wins!" << endl;}

  board.PrintBoard();

}

4 0
3 years ago
Other questions:
  • Advances in vehicle manufacturing technology have decreased the need for:
    10·1 answer
  • R 134a enters a air to fluid heat exchanger at 700 kPa and 50 oC. Air is circulated into the heat exchanger to cool the R134a to
    6·1 answer
  • Which definition best fits the idea of electrical resistance in a wire? A. the decrease in current flow due to electrons collidi
    12·1 answer
  • Sam constructs a circuit, connects a lead acid battery of 2 V to a lamp of resistance 3 Ω and places an ammeter across it. What
    8·2 answers
  • 4 main causes of erosion
    12·1 answer
  • (30 pts) A simply supported beam with a span L=20 ft and cross sectional dimensions: b=14 in; h=20 in; d=17.5 in. is reinforced
    13·1 answer
  • The heat transfer surface area of a fin is equal to the sum of all surfaces of the fin exposed to the surrounding medium, includ
    6·1 answer
  • 8- Concentration polarization occurs on the surface of the.......
    15·1 answer
  • Importance of tillage​
    7·1 answer
  • What is the tolerance for number 4?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!