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]
2 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]2 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
Why might you want to save a downloaded file to your computer first instead of running it immediately?
sukhopar [10]

Answer:

Explanation:

Run: Choose Run when you only need the download once. Perhaps it’s a song or video you only plan to listen to or watch once. Another scenario might be an installation program that, when run, installs software on your machine in other, permanent locations. Once installed, you probably don’t need the installer again.

Save: When you want to keep whatever it is you’ve downloaded, choose Save. You can still run it, or whatever else you’d like to do with it, but you’ll need to do that yourself. You’ll also want to decide where, on your computer, to keep the file.

<em>Save and run: Use this option when you want to do both: save the file to a location you control, and then immediately run it. </em>

<em />

8 0
2 years ago
Please sign this!! https://www.change.org/ban-charli-damelio
pav-90 [236]

Answer:

Idc

Explanation:

5 0
2 years ago
Read 2 more answers
The ________ is the easy way to insert a new slide between existing slides.
Tema [17]
What is the subject about?
7 0
3 years ago
Which type of address defines a single network interface in a computer or other device?
White raven [17]
MAC address
......... ..
4 0
2 years ago
Which of the following is not a benefit of shaping data with the Power Query Editor?
algol13

Answer:

A

Explanation:

I am not 100% sure but without the shaping data, data can still be merged from multiple sources.

3 0
2 years ago
Other questions:
  • The technology (software) that automatically downloads website information to your computer is called ________.'
    15·1 answer
  • Janelle is at the store and can't decide whether to buy steak for dinner or bring home pizza. To get a quick response from her p
    13·1 answer
  • if a second system failure occurs while the first recovery is in progress, what needs tobe done after the system recovers for th
    11·1 answer
  • Define Agricultural Era
    14·2 answers
  • Which of the following variable names follows the rules for naming variables?
    13·1 answer
  • Any looping construct can be nested inside another loop is known as
    11·1 answer
  • How does a modem work​
    13·1 answer
  • How would you open the web browser in Linux and still have access to the Linux terminal?
    14·1 answer
  • From which country samsung is​
    6·2 answers
  • it is good to know and use the npsd framework while solution envisioning as part of the value discovery cycle. What is NPSD?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!