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
Determine the exact output of the code $str = "The quick brown fox jumps over the the lazy dog"; echo strpos($str, 'fox');
LuckyWell [14K]

Answer:

b. 16

Explanation:

The given PHP code segment consists of 2 statements.

$str="The quick brown fox jumps over the lazy dog";

This defines a variable $str and assigns the given text to it.

echo strpos($str,'fox');

This statement prints the location of 'fox' in the text associated with the variable $str.

Upon execution it will print the value 16 which corresponds to the position of 'fox' in the given sentence.

3 0
3 years ago
1. Why is photographing lightning a difficult process?
bulgar [2K]
<span>1. Why is photographing lightning a difficult process?
</span>Some reasons which come to my mind for saying this are: 1) You get only one chance for the particular situation - it is not like portrait photography where you can go back in the studio if the photos didn't come out well; 2) lightning varies so much in brightness, intensity and location that guessing the proper exposure requires a lot of experience, as well as luck; 3) you are always at some risk when photographing worthwhile lightning; and 4) lightning is a point (line) source, and demands the most of the optical quality of your camera 
<span>
2. What piece of equipment is helpful in capturing lightning photographs?
</span><span><span>SLR camera with B-shutter speed (preferably SLR; you might try using your digital camera, if it has B mode, but this is much more difficult)</span><span>lenses ranging from 28mm to 135mm at minimum. Fixed-focal lenses are preferred over zoomlenses. Aperture ranges should be f/2.8 - f/22.</span><span>sturdy tripod (metal or plastic doesn't make any difference whatsoever at all in safety - if lightning is so close by, you are in trouble anyway)</span><span>cable release, which can be locked</span><span>Slow-speed film: 100 or 200 ISO
</span></span><span>
3. Why is it important to mentally prepare for photographing lightning?
</span><span>When photographing lightning, it’s important to realize that the conditions you are shooting in are unpredictable and dangerous, and there will always be an element of chance and luck involved. So you should prepare yourself.
</span><span>
4. What time of day should you try to photograph lightning?
</span>Nighttime lightning photography is the easiest <span>type
</span><span>
5. Why is composition important in lightning photographs?
It boosts or adds drama to your picture. </span>
6 0
3 years ago
Read 2 more answers
Top 5 best comedy or action movies.
Cloud [144]
Comedy movies you should watch is
grown ups
spider man into the spider verse
action movies you can do
like a fast and furious movie ?
some cool scary movies are
the strangers
insidious
and the serbian film :)
7 0
3 years ago
Read 2 more answers
What does a file extension tell you?
kiruha [24]

A. because everyone basically has seen it..

3 0
3 years ago
You're the sole IT employee at your company, and you don't know how many users or computers are in your organization. Uh oh! Wha
Neporo4naja [7]

Answer

Directory Services

<u></u>

<u>Definition</u>

It is a type of software that is used to unify and customize the resources available at the network.

<u>Explanation</u>

This software is used to gather the information and addresses of all computers connected on the network.

It is a type of information store, where all the information related to resources (computer) and services of network has been stored. It also gives administrator rights to the single point to manage whole network resources.

This is the reason, Option "D" is the best choice for me as sole IT employ in a company. I will prefer directory services software to gather the information of all computers of organization and manage users in company.  

4 0
3 years ago
Other questions:
  • Access controls are enforced automatically in FMS service routines that access and manipulate files and directories.
    9·1 answer
  • MATLAB graphics user interface:<br> Describe what Folder, Command Window and Workspace are.
    5·1 answer
  • What could prevent earmuffs from providing your ears good protection from noise?
    10·1 answer
  • 1) If a client requests timestamping every two minutes, how would it look? a) [00:02:00] b) [00:06:00] c) (00:04:00)
    15·2 answers
  • How can a network design project benefit from the principles of itsm? How might itsm impede a network design project?
    11·1 answer
  • How can you add contrast between text and headlines in a document? increase the font size of the headline make the headline long
    6·1 answer
  • A virus is a self-replicating program that produces its own code by attaching copies of it into other executable codes.
    7·1 answer
  • Which of the following operating systems is able to join a domain a) Microsoft office pro b) Microsoft surface R.T. c) google an
    9·2 answers
  • What is the traditional cognitive perspective ofHCL?
    12·1 answer
  • What is 2+2 I need to know hurry
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!