Question

I'm working on a mat lab assignment and I need to graph just the maximums out...

I'm working on a mat lab assignment and I need to graph just the maximums out of a vector of data. The data is sinusoidal in nature I want to access just the maximum values from it.  

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

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

clc
clear all
t=0:0.01:10*pi;
y=sin(t);
ind=[];
for i=2:length(t)-1
if(y(i-1)<y(i)&&y(i)>y(i+1))
ind=[ind i];
end
end
disp('The maximums are');
y(ind)
disp('Maximums are at index');
ind
plot(t,y,t(ind),y(ind),'*r')

Figure File Edit View nsert Tools Desktop Window Help 0.8 0.6 0.4 0.2 0.2 -0.4 0.6 -0.8 10 15 20 25 30 35 O Type here to sear

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
I'm working on a mat lab assignment and I need to graph just the maximums out...
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
  • I'm working on a lab for an online class. I can't figure this question out: Roots...

    I'm working on a lab for an online class. I can't figure this question out: Roots that develop from nonroot tissues, such as nodes of stems, are called adventitious roots. Examples of adventitious roots include the prop roots of corn, as well as the aerial roots of ivy that attach this plant to such structures as stone walls. Name some adventitious roots on display. (Since this is online there are pictures attached with the parts of the lab to work...

  • Hi I need help plotting this graph from my thin lenses lab. They want me to...

    Hi I need help plotting this graph from my thin lenses lab. They want me to pick two sets of points from my data. The first set will become p1 and q1 and the second set will become p2 and q2. Plot q1 and p1, and q2 and p2 on the same graph. (Hint: select values of p1 and p2 such that the difference between them is at least 30cm.) I'm using this to find the the intersection of the...

  • I'm having trouble with numbers 5 to 7. I need help working out the equation in...

    I'm having trouble with numbers 5 to 7. I need help working out the equation in question 5 so I can graph it for number 6 and using the slope from the graph to solve number 7. 1. 2 points Measure ands record the em.f E of the given cell. E = 5.65 v 2. Connect an external resistance R=12 and measure the terminal voltage V across the resistor. 2 points 1 ohm = 4.42 3. 1 Repeat step 2...

  • I'm having trouble with numbers 5 to 7. I need help working out the equation in...

    I'm having trouble with numbers 5 to 7. I need help working out the equation in question 5 so I can graph it for number 6 and using the slope from the graph to solve number 7. 1. 2 points Measure ands record the em.f E of the given cell. E = 5.65 v 2. Connect an external resistance R=12 and measure the terminal voltage V across the resistor. 2 points 1 ohm = 4.42 3. 1 Repeat step 2...

  • I need help in MATLAB. I'm working on a circuits lab report and I want to...

    I need help in MATLAB. I'm working on a circuits lab report and I want to plot the derivative of an input signal. The circuit is a differentiator OpAmp. It is receiving a triangle wave as an input and should output a square wave. (I've included my existing code.) The output formula is: Vout = -(Rf)*C*(dVin/dt) Where Rf is feedback resistance: Rf = 1*10^6; and C = 1*10^-6. EXISTING CODE: %% This section is copied, and then modified from another...

  • I'm currently working on a problem and I'm stuck at this step --> I need to...

    I'm currently working on a problem and I'm stuck at this step --> I need to get Q to equal 504 from this equation, 0.45V = 0.53V - 0.0592/2 logQ No matter what I try I can't seem to get Q=504 as an answer for that. Please help and explain how you got it! Thank you!! ..I know the first step would be to -0.53 from both sides which gives me -0.08= -0.0592/2 logQ but then I don't know what...

  • Hello there, I'm working on an spss assignment and I have two sets of variables Age1...

    Hello there, I'm working on an spss assignment and I have two sets of variables Age1 and Partners Age2, I'm needing to figure out how to get the percentage of both Age1 and Partners Age2 that are 51 years old and older. May I ask how to do this in spss? thanks!

  • MATLAB This is a copy and paste of what we need to do. Enter this in...

    MATLAB This is a copy and paste of what we need to do. Enter this in MATLAB. Please explain what you are doing and why. I don't just want the answer. I want to study this. This is a 100 class and the teacher teaches it as if we are 300 students.... please help me learn not just get the answer % q11_sol.m % % Quiz #11 solutions % February 11, 2020 % %% Part 1 % For the given...

  • I'm working on Graph implementation in Java. I can't figure out why the method isConnected() using...

    I'm working on Graph implementation in Java. I can't figure out why the method isConnected() using Breadth-first traversal doesn't work. It always returns false, and its count is always zero. Could I get a piece of advice? public boolean isConnected() {    if (isEmpty())        return false;       Iterator<T> traversal = iteratorBFS(0);    int count = 0;       while (traversal.hasNext())    {        traversal.next();        count++;    }      System.out.println(count);       return (count ==...

  • I just need help working out the centroid of the shape, nothing more please.

    I just need help working out the centroid of the shape, nothing more please.

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