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
Sav [38]
2 years ago
14

Homework 8 Matlab Write a function called fibonacciMatrix. It should have three inputs, col1, col2, and n. col1 and col2 are ver

tical arrays of the same length, and n is an integer number greater than 2. It should return an output, fib, a matrix with n columns. The first two columns should be col1 and col2. For every subsequent column:
Computers and Technology
1 answer:
Amiraneli [1.4K]2 years ago
8 0

In this exercise we have to use the knowledge in computational language in python to write the following code:

We have the code can be found in the attached image.

So in an easier way we have that the code is:

<em>function v = myfib(n,v)</em>

<em>if nargin==1</em>

<em>    v = myfib(n-1,[0,1]);</em>

<em>elseif n>1</em>

<em>    v = myfib(n-1,[v,v(end-1)+v(end)]);</em>

<em>end</em>

<em>end</em>

<em>function v = myfib(n,v)</em>

<em>if nargin==1</em>

<em>    v = myfib(n-1,[0,1]);</em>

<em>elseif n>1</em>

<em>    v = myfib(n-1,[v,v(end-1)+v(end)]);</em>

<em>elseif n<1</em>

<em>    v = 0;</em>

<em>end</em>

<em>function [n] = abcd(x)</em>

<em>if (x == 1 || x==0)</em>

<em>    n = x; </em>

<em>    return</em>

<em>else</em>

<em>    n = abcd(x-1) + abcd(x-2);</em>

<em>end</em>

<em>end</em>

<em>fibonacci = [0 1];</em>

<em>for i = 1:n-2</em>

<em>    fibonacci = [fibonacci fibonacci(end)+fibonacci(end-1)];</em>

<em>end</em>

<em>>> myfib(8)</em>

<em>ans =</em>

<em>    0    1    1    2    3    5    8   13</em>

<em>>> myfib(10)</em>

<em>ans =</em>

<em>    0    1    1    2    3    5    8   13   21   34</em>

See more about python at  brainly.com/question/18502436

You might be interested in
What is the advantage of defining a target user?
spayn [35]
3) helps the designer develop a website tailored to the desired audience
4 0
3 years ago
Marisol manages the online advertising campaigns for a chain of toy stores with both a physical and an online presence. Which Go
tatiyna

Answer:

Marisol must make use of the Shopping campaign for showing the image of her products, as well as advertise her company's online as well as the local inventory of the toys, as well as boost the traffic to their site and the local toy stores. These types of ads are displayed on Google Shopping which comes just after the search results and near the responsive and text ads.

Explanation:

Please check the answer section.

8 0
3 years ago
Read the section, "Junior Year." Why would someone chose to complete an apprenticeship after high school? How many occupations c
Tamiku [17]

An apprenticeship prepares you for a career through a structured program of on-the-job learning with classroom instruction, while you work and earn a salary. The programs can last from one to six years and you can choose careers in areas such as telecommunications, health care, computing, business support and the arts. The most common apprenticeships are in construction and manufacturing. If you like to work with your hands and your mind, you might want to consider an apprenticeship after high school. More than 850 occupations can be learned on the job through an apprenticeship.

7 0
3 years ago
Read 2 more answers
Identify a logical operation (along
tankabanditka [31]

Answer: Provided in the explanation section

Explanation:

The Question says;

Identify a logical operation (along

with a corresponding mask) that, when

applied to an input string of 8 bits,

produces an output string of all 0s if and

only if the input string is 10000001.​

The Answer (Explanation):

XOR, exclusive OR only gives 1 when both the bits are different.

So, if we want to have all 0s, and the for input only 10000001, then we have only one operation which satisfies this condition - XOR 10000001. AND

with 00000000 would also give 0,

but it would give 0 with all the inputs, not just 10000001.

Cheers i hope this helped !!

3 0
4 years ago
Select the correct answer.
MrRissso [65]

Answer:

Pie Chart

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • The correct syntax for accessing the length of an array named numbers is:
    15·1 answer
  • To define a c-string that will store students' last names of up to 25 characters in length, which is an appropriate statement?
    9·1 answer
  • Choose the appropriate of an image that supports the text. You should also make sure that the image is
    12·2 answers
  • An iterative algorithm uses a loop to solve the problem, while a recursive algorithm uses a method that calls itself. (true, fal
    7·1 answer
  • Susan is in charge of the inventory reports for her company.She will need to find specific inventory items as well as project in
    9·1 answer
  • Which format of image files can be inserted in html?​
    8·2 answers
  • Write a statement that declares an anonymous enumerated type with the enumerators SMALL, MEDIUM, and LARGE.
    13·1 answer
  • A social media site violates its terms of service by selling information about its users
    7·1 answer
  • The temperature at 8 AM was 44°F and at noon it was 64°F. what was the percent of change from 8 AM to noon?
    11·1 answer
  • What is ICT?Write down the uses of ICT​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!