Question

integers between 5 and 400 Use MATLAB command windows to create a vector with all a) Ans) deconv Write a function integerdi
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) Just type r=[5:400]' in command window. It creates a column vector of integers from 5 to 400. If you want row vector just type r=[5:400]

b) To create a function in MATLAB, first open m file and save it with name 'integerdivision'

now type following commands and SAVE

function [s,p]=integerdivision(a,b)
[s,p] =deconv(a,b);

let us test it. let the polynomial is 2x3+7x2+4x+9 divided by x2+1. Answer is quotient=2x+7

and remainder 2x+2. Now take another m file and type following (coefficient vectors n and d while r and q are remainder and quotient values obtained from function)

n=[2 7 4 9];
d=[1 0 1];
[r,q]=integerdivision(p,q)

answer pops in command window as

r =

2 7
q =

0 0 2 2

d) to find roots use roots function. Type following in command window

t=[1 2 -5 7 12 20];
k=roots(t)

2) a) type following in m file and run

a=[2,4,10,13; 16,3,7,18;8,4,9,25;3,12,15,17];
length(a)
size(a)
b=a(2:3,1:3)
b(5)

Output in command window is

ans =

4
ans =

4 4
b =

16 3 7
8 4 9

ans =

7

Add a comment
Know the answer?
Add Answer to:
integers between 5 and 400 Use MATLAB command windows to create a vector with all a)...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT