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
45 points!!
pav-90 [236]

Answer:

ENQUIRE database system

Explanation:

5 0
3 years ago
Read 2 more answers
Who watches the show gravity falls, if you do, if you play the theme song for the first episode backwards you get a hiding messi
Yakvenalex [24]
I don’t really knowwww but thanks
4 0
3 years ago
Read 2 more answers
A hard drive cannot be partitioned until the device <br> is set.
PilotLPTM [1.2K]
Yeah that true I asked my grandpa
3 0
2 years ago
Which is NOT a way the network operating sys-
irakobra [83]

Answer: A user authentication

3 0
3 years ago
A well-diversified portfolio needs about 20-25 stocks from different categories is this True or False?
borishaifa [10]

Usually they hold 15-20 as the minimum of the portfolios

So I would say True

3 0
3 years ago
Read 2 more answers
Other questions:
  • Compare and contrast how the roles of women and men in society are changing​
    14·1 answer
  • The main devices in a rectifier are:
    14·2 answers
  • Write a definition of the function printDottedLine, which has no parameters and doesn't return anything. The function prints to
    14·1 answer
  • What is the correct order of headers, from left to right, in a completed frame?
    8·1 answer
  • what are the benefits of VolP? select all that apply. A:cheaper printings B:clearer calls C: faster download D: increased effici
    11·2 answers
  • Data stored on physical storage devices must do what before the processor can access it? Be converted to binary Be written to th
    9·1 answer
  • What do you call a collection of pre-programmed commands and functions used in programs?
    10·1 answer
  • What will the following program display in the console?
    12·1 answer
  • Explain how you think robotics plays a part in the subway driver's job.
    13·2 answers
  • A file has TWo parts name them
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!