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
How can i clear the CMOS​
motikmotik

Explanation:

Steps to clear CMOS using the battery method

Turn off all peripheral devices connected to the computer.

Disconnect the power cord from the AC power source.

Remove the computer cover.

Find the battery on the board. ...

Remove the battery: ...

Wait 1–5 minutes, then reconnect the battery.

Put the computer cover back on.

4 0
3 years ago
Which of these statements about digital media is NOT accurate?
DIA [1.3K]

Answer:

It is any information that is audio or video but not text.

Explanation:

5 0
2 years ago
What is the advantage of learning through story compared to learning through personal experience?
Inessa [10]

Answer:

Personal Experience

Explanation:

If a story is based on a personal experience then yes, the two doesn't matter. <em>However</em>, usually learning through personal experience is better because you learn firsthand while stories are written from a different perspective.

6 0
3 years ago
Read 2 more answers
Match each option to the description of the task it accomplishes.
muminat

Answer:

Follows are the solution to the given question:

Explanation:

Please find the attached file of the matching.

Arrange: In shape formatting, the "arrange" is used to provide an arrangement in the positing of the shape on the given slide.

shape styles: In shape formatting, it is used for applying a new design to the shape.

size: In shape formatting, the size is used for modifying the shape.

insert shapes: In shape formatting, the insert shape is used to add a new shape.

Wordart styles: In shape formatting, Wordart is used to provide a text design on the shape.

5 0
3 years ago
Sara is asked to create a controller for light sensors. When the light falls on the sensor, it needs to indicate when a particul
Marrrta [24]

Answer:

Arduino

Explanation:

<em>Arduino is a free and open-source electronics platform with simple hardware and software. Arduino boards can read inputs, turn on a sensor and transform it into an output, activate a motor, and turn on an LED. Sara may direct her board by sending a series of instructions to the board's microcontroller. To accomplish so, she used the Arduino programming language and the Arduino Software (IDE), both of which are founded on Processing.</em>

7 0
2 years ago
Other questions:
  • Questions 6 - 9 Refer to the following code: public class WhatsIt { private int[] values; private double average; public WhatsIt
    7·1 answer
  • HELP ASAP!!!!!!!!! ITS A UNIT TEST: WILL MARK AS BRAINLIEST&gt;
    13·1 answer
  • The point at coordinates (2, -18) is in what direction from the origin?
    7·1 answer
  • Complex communication skills will probably never be outsourced to a computer because they require the human touch.
    8·1 answer
  • In windows xp, which control panel icon should you choose if you would like to customize your system for left-handed use?
    7·2 answers
  • Katarina is deciding whether to buy a desktop or a laptop computer. What will most likely help Katarina make her decision?
    10·2 answers
  • What is a slide master ?
    8·2 answers
  • Lucas wants to expand his vocabulary to better understand the sentence below. The insidious burglar moved through the house unhe
    7·2 answers
  • We call any device connected to the Internet a(n) ________. Group of answer choices router host IP client
    9·1 answer
  • Data elements in a relational database are organized into ____
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!