Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9227951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:12:20+00:00 2026-06-18T05:12:20+00:00

I am trying to create an m-file function for a sine signal with input

  • 0

I am trying to create an m-file function for a sine signal with input tmin, tmax, time-period, amplitude, but I don’t know how to to begin. I am a newbie with Matlab.

My Sine function has the following code

function  y=sin(x)

y=sin(x); 

In the command window, I type plot(mysine(x)); to get the sine signal, but this is all I know.

How do you set the tmin, tmax, time-period, amplitude ?

I want to have something like this

[x] = mysine(-10,10,0.25,2);
plot(x);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:12:21+00:00Added an answer on June 18, 2026 at 5:12 am

    This is a very simple question which isn’t really to do with programming and I suspect it is homework.

    if sine has the following form:

    a*sin(b*x+c)+d
    
    a affects the amplitude
    b affects the time-period
    c affects the phase
    d affects the amplitude offset
    

    Basically what you are wanting to do is this:

    plot(tmin:timePeriod:tmax, amplitude*sin(tmin:timePeriod:tmax))
    

    which will produce something like this:

    enter image description here

    Which is the sine form you are looking for I believe.

    As a function:

    function x = mysine(tmin, tmax, timePeriod, amplitude)
         x = plot(tmin:timePeriod:tmax, amplitude*sin(tmin:timePeriod:tmax))
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a PHP file that calls a function in another file.
I'm trying to create a file with a unique file name for every time
I`m trying to create a file downloader as a background service but when a
I am trying to create a file with all function/enum/struct/etc names from a source
I'm trying to create a .tgz file through the PHP exec(); function in an
I'm trying to create a PDF file with a table of data.. But when
I am trying to create a fieldset that will append a file input field
I am trying to create a zip file using servlets but it returns me
I am trying to create a migration file in Codeigniter but when I run
I've been trying to create a function that will write a minidump file for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.