Question

Assume that y is a column vector with ten elements, write matlab code that will create...

Assume that y is a column vector with ten elements, write matlab code that will create a stem plot of the vector starting at a horizontal axis value of 1. Add code that will create the stem plot of the vector starting at a horizontal axis value of 0. Create additional code that creates a stem plot but plots y at every other horizontal value (i.e., 0, 2, 4, etc)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

% Program -1

clc;
close all;
clear all;
y=[0;1;2;3;4;5;6;7;8;9] %column vector with ten elements
x=1:1:10;
stem(x,y);

output:

y =

0
1
2
3
4
5
6
7
8
9

2345678910

% Program -2

clc;
close all;
clear all;
y=[0;1;2;3;4;5;6;7;8;9]
x=1:1:10;
subplot(2,1,1)
stem(x,y);
x1=0:1:9;
subplot(2,1,2)
stem(x1,y);

output:

G- GH NHO 900 + NO 900 + NO

% Program -3

clc;
close all;
clear all;
x=0:1:9;
y=2*x;
stem(x,y)

output:

字 1 2 3 4 5 6 7 8 9

Add a comment
Know the answer?
Add Answer to:
Assume that y is a column vector with ten elements, write matlab code that will create...
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