Results 1 to 6 of 6

Math Help - assigning particular value based on x asis

  1. #1
    Newbie
    Joined
    Jun 2010
    Posts
    8

    assigning particular value based on x asis

    sir,
    i have a signal.it ends at say x=2 in xaxis.
    i want to assign zero valuefrom x=2 upto x=3 in xaxis.can u tell me which command should i use for it
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Master Of Puppets
    pickslides's Avatar
    Joined
    Sep 2008
    From
    Melbourne
    Posts
    5,234
    Thanks
    27
    y=0, x\in [2,3]
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jun 2010
    Posts
    8
    what is the command for it in matlab
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Master Of Puppets
    pickslides's Avatar
    Joined
    Sep 2008
    From
    Melbourne
    Posts
    5,234
    Thanks
    27
    You never mentioned Matlab or what the signal was for x<2 and x>3
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Jun 2010
    Posts
    8
    clc;
    clear all;
    Ytot=0.0;
    f=100000;
    for j=1:1
    R=4E+6; % Synchronized Rate (Max)
    dt=1/R; % Sampling Time for output
    t=0;
    Y=0;
    Y1=0;
    N=5; % Number of cycles
    L=N/(dt*f); % Length of signal

    for i=1:L
    Y1(i)=4*(1-cos(t*2*pi*f/N))* sin(t*2*pi*f);
    t=t+dt;
    end
    for i=1:L
    Y(i)=0.0;
    end
    Y=[Y Y1 ];
    if j==1
    Ytot=[Y];
    else
    Ytot=[Ytot Y];
    end



    end
    t=([1:1:length(Ytot)])*dt;
    subplot(2,1,1)
    plot(t,Ytot);




    -------------------------------------------------------------------


    this is the signal
    i want to add more zeros to the end of the signal upto my desired value corresponding to x axis
    can u tell me which is the matlab command that i should use
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Member
    Joined
    Mar 2007
    Posts
    206
    Awards
    1
    Try this:

    Code:
    clc;
    clear all;
    Ytot=0.0;
    f=100000;
    for j=1:1
        R=4E+6; % Synchronized Rate (Max)
        dt=1/R; % Sampling Time for output
        t=0;
        Y=0;
        Y1=0;
        N=5; % Number of cycles
        L=N/(dt*f); % Length of signal
        
        for i=1:L
            Y1(i)=4*(1-cos(t*2*pi*f/N))* sin(t*2*pi*f);
            t=t+dt;
        end
        for i=1:L
            Y(i)=0.0;
        end
        Y=[Y Y1 ];
        if j==1
            Ytot=[Y];
        else
            Ytot=[Ytot Y];
        end
        
        
        
    end
    t=([1:1:length(Ytot)])*dt;
    h = subplot(2,1,1)
    plot(t,Ytot);
    set(h,'xlim',[0.6 0.9].*10^(-4))%<---------------------------------------------------
    Regards Elbarto
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Solving for x and y based on ratio
    Posted in the Algebra Forum
    Replies: 1
    Last Post: May 19th 2010, 03:07 AM
  2. commission based pay
    Posted in the Business Math Forum
    Replies: 1
    Last Post: April 13th 2010, 06:41 AM
  3. Probability of assigning people to things
    Posted in the Statistics Forum
    Replies: 3
    Last Post: January 6th 2010, 08:55 AM
  4. assigning proof grades--please check my work
    Posted in the Advanced Algebra Forum
    Replies: 1
    Last Post: March 20th 2009, 01:17 PM
  5. Maple- Assigning values inside 'proc'
    Posted in the Math Software Forum
    Replies: 5
    Last Post: November 11th 2008, 01:00 PM

Search Tags


/mathhelpforum @mathhelpforum