Question
Please help me to solve this two Tasks by MATLAB Task 1 A)Prompt the user to enter a matrix of numbers of any dimension and
Please help me to solve this two Tasks by MATLAB
Task 1
A)Prompt the user to enter a matrix of numbers of any dimension and determine;
i.The dimensions of the entered matrix.
ii.The summation of each column by using:
A.For loop. (Note: use the entered matrix itself as index for the loop. This is explained in page 4 in this document).
B.While loop to sum the columns. (Use a counter variable i that is equal to the number of columns of the input matrix and determine the sum of the ith column directly by selecting the whole column by the index number.
iii.The summation of each row by using the procedures A and B on the transposed version of the input matrix. (Note: the columns of the input matrix become the rows of the transposed matrix).
Task 2
A Fibonacci sequence is composed of elements created by adding the two previous elements. The simplest Fibonacci sequence starts with 1 and proceeds as follows: ?
1, 1, 2, 3, 5, 8, 13, ...
?However, a Fibonacci sequence can be created with any two starting numbers. Fibonacci sequences appear regularly in nature. For example, the shell of the chambered nautilus grows in accordance with a Fibonacci sequence. ?
Write a script that displays the elements of Fibonacci sequence that are between two numbers entered by the user.
The script should follow the following pseudo-code:
* Prompt the user for two numbers a and b.
* If a < b proceed otherwise display an error message: Sorry the lower interval limit is to be entered first.. Try again !
*
Generate all Fibonacci number starting from 1 till reaching b. The last Fibonacci element should be less or equal to the upper limit number b.
*Use the find command to select the elements between a and b.
%%For example:
*If the user enters 4 and 8 the results will be [5 8]
*If the user enters 6 and 6 the result should be interval is too short or no Fibonacci numbers are found
*If the user enters 5 and 4 the result should be
Please copy the task .
Thanks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started