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
vesna_86 [32]
3 years ago
11

What is the Matlab command to create a vector of the even whole numbers between 29 and 73?

Computers and Technology
1 answer:
Nana76 [90]3 years ago
6 0

Answer:

x = 29:73;

x_even = x(2:2:end);

Explanation:

In order to create a vector in Matlab you can use colon notation:

x = j:k

where <em>j</em> is 29 and <em>k</em> is 73 in your case:

x = 29:73

Then you can extract the even numbers by extracting the numbers with even index (2,4,6,etc.) of your vector:

x_even = x(2:2:end);

In the line of code above, we define <em>x_even</em> as all the elements of x with even index from index 2 till the end index of your vector, and an increment of 2 in the index: 2,4,6,etc.

If you want the odd numbers, just use the odd indices of your vector:

x_odd = x(1:2:end);

where <em>x_odd</em> contains all the elements of <em>x</em> with odd index from index 1 till the end index, and an increment of 2: 1,3,5,etc.

You might be interested in
Which device in a wireless local area network determines the next network to which a packet should be forwarded??
tatiyna
Router



---------------------
8 0
4 years ago
You have used loops for repetitive processes.
zzz [600]

Answer:

for

Explanation:

because:

  • IF = conditional
  • WHILE = conditional
  • DO = isn't a loop function
5 0
3 years ago
After you save a table, the new table name appears ____.
kobusy [5.1K]
Table1/2.....hope it helps
5 0
3 years ago
Read 2 more answers
What is the name of the process that weighs the alternatives, gathers all necessary information, and can ultimately lead you to
blondinia [14]
This process is known as decision making.
8 0
3 years ago
Read 2 more answers
What shortcut keys do i use to print something on my keyboard ?
romanna [79]
CTRL+P. It's usually pressed when you want to print something.
5 0
3 years ago
Read 2 more answers
Other questions:
  • What are some tasks Petroleum Engineers perform?
    5·2 answers
  • If you want to prioritize downloads of your mobile app instead of visits to your mobile site, you should: a) add a sitelink exte
    10·1 answer
  • __________ describes a module for which the software developer does not care how the processing is performed, but instead, knows
    7·1 answer
  • What are the diffrent types of contract
    9·1 answer
  • Ellen has eggs she wishes to trade for grain. However, she cannot find anyone with grain that needs eggs. What is missing for th
    14·1 answer
  • Question 2 of 10
    13·1 answer
  • Assume your sketch has a variable named silo, which stores an object that is defined by a class you have created. The name of th
    15·1 answer
  • What is output? x=-2 y=-3 print (x*y+2)
    10·1 answer
  • What is it called when u want 2 or more cells into 1
    14·2 answers
  • List resource you can utilize if you are experiencing technology issued
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!