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 bug was supposed to start affecting computers on january 1 2000
horsena [70]

Answer: Y2K bug, also called Year 2000 bug or Millennium Bug

5 0
3 years ago
Which statement describes one of the responsibilities of a computer programmer?
galben [10]

Answer:

d i think

Explanation:

6 0
3 years ago
A Transmission Control Protocol (TCP) connection is established and two devices ensure that they're speaking the same protocol.
son4ous [18]

Answer:

The answer is "Three-way handshake".

Explanation:

In this mechanism, two processes associated with communication throughout SEO techniques. In this, the sequence of data packets and recognized by the number of exchanges during the threefold handshake process.

  • This method initiating the process between two apps,  Handshaking begins whenever a computer sends the message to its system.
  • The process of the communication system has been established into the two devices,  which simply send many messages, which allow them to settle the protocol for communication.
6 0
3 years ago
What term refers to a written report given about an event or other newsworthy subject? A. press box B. press kit C. press pass D
guajiro [1.7K]
D. Press release is the correct answer. 
4 0
3 years ago
Read 2 more answers
Write a simple nested loop example that sums the even and odd numbers between 5 and 15 and prints out the computation.
lianna [129]

Answer:

for e in range(6, 15, 2):

for o in range(5, 15, 2):

calc = e+o

print(e, "+", o, "=", calc)

Explanation:

4 0
3 years ago
Other questions:
  • What are the differences between a slate PC, ultrabook, and a tablet?
    5·1 answer
  • A key field is used to _____. enter a password uniquely identify records merge data list the most important information
    12·2 answers
  • At what x position are the ellipses drawn??? thanks ♡​
    6·1 answer
  • Object-oriented systems have three general types of cohesion: _____, _____, and _____. A. method, class, inheritance B. method,
    10·1 answer
  • Write a simple hello world program in python 3
    8·2 answers
  • What allows you to heal<br><br><br><br> undesirable portions of an image​
    9·1 answer
  • What is 11.2 rounded to the nearest one?​
    12·2 answers
  • While there are a some exceptions such as an if-statement, Scheme has one primary syntax () a) True b) False
    14·1 answer
  • Write a Python3 program to check if 3 user entered points on the coordinate plane creates a triangle or not. Your program needs
    12·1 answer
  • Which compound is obtained by the oxidation of primary alcohol with nascent oxygen​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!