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
Which is the correct attribute syntax
taurus [48]

ANSWER:  GIVE ME BRAINLIEST AND ILL GIVE YOU THE ANSWER

EXPLANATION: ALL YOU NEED TO DO IS GIVE ME BRAINLIEST FOR THE ANSWER

3 0
3 years ago
Ally typed a business letters she most likely used a
Zarrin [17]

Answer:

Ally typed a business letters she most likely used a  <u>Word Processor</u>.

Explanation:

Word processors are the tools that are used to process the text in terms of formatting, printing and editing the text document. These programs or software are used to write the text document with ease.

Microsoft word and word perfect are the examples of the word processors.

We can write the text on note pad as well, but we cannot apply different fonts style, size and formatting techniques on that application. Word processors provide a lot of fonts styles and formatting options to make the document appealing.

6 0
3 years ago
Q1: Which of the following is an input peripheral device?
faltersainse [42]

Answer:

Mouse

Explanation:

Input devices allow users to input something in the computer. For example keyboard allows users to type on the computer, or mouse allows users to click.

On the other hand output devices allow computers to output data. For example speakers allow us to hear the outputs of a computer.

3 0
3 years ago
Read 2 more answers
Why is audio greyed out on powerpoint ms office 2011?
-BARSIC- [3]
Because its a old type of software and probably wont run on your computer
7 0
3 years ago
Draw the Abstract Syntax Trees for the following statements and represent them in text form. i) 1+2+3 ii) 6÷3×4+3
MArishka [77]

Answer:

your a legend you can do it just pleave

Explanation:

:)

5 0
3 years ago
Other questions:
  • How can u refer to additional information while giving a presentation
    15·1 answer
  • What is a Windows feature that allows you to temporarily store text?
    5·1 answer
  • A computer’s memory is composed of 8K words of 32 bits each. How many bits are required for memory addressing if the smallest ad
    10·1 answer
  • I will mark brainalist! ​
    5·1 answer
  • The device used to connect a network to the internet is called a
    7·1 answer
  • This is in government
    15·1 answer
  • A vacuum tube that contains a grid can be classified as a A. rectifier B. triode C. pentode D. diode
    12·1 answer
  • A _______ policy states that the company may access, monitor, intercept, block access, inspect, copy, disclose, use, destroy, or
    5·1 answer
  • How do you increase the number of tries by one?
    10·1 answer
  • Find an interesting case on the concept of intellectual property
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!