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

  • SEARCH
  • Home
  • 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 7493643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:06:04+00:00 2026-05-29T17:06:04+00:00

In the following code, I need 1 lakh samples in the array mydata .

  • 0

In the following code, I need 1 lakh samples in the array mydata. I don’t know what I am getting out of mydata. Do I have to increase the range of t to get that. And how can I use the data in mydata into another .m file for further processing.

t  = [ 1 : 1 : 500]; % Time Samples
f1=10000; % Input Signal Frequency
f2=20000;
f3=30000;
f4=f2+f3;
f5=f1+f3;
f6=f4+f2;
f7=f1+f6;
f8=45000;
f9=55000;
f10=35000;
mydata=[1:100000];
Fs = 100000; % Sampling Frequency
for i=1:100000
    if(i<=10000)
        mydata = sin(2*pi*f1/Fs*t);
    elseif((i>10000)&&(i<=20000))
       mydata=sin(2*pi*f2/Fs*t);
    elseif((i>20000)&&(i<=30000))
        mydata=sin(2*pi*f3/Fs*t);
    elseif((i>30000)&&(i<=40000))
        mydata=sin(2*pi*f4/Fs*t);
    elseif((i>40000)&&(i<=50000))
        mydata=sin(2*pi*f5/Fs*t);
    elseif((i>50000)&&(i<=60000))
        mydata=sin(2*pi*f6/Fs*t);
    elseif((i>60000)&&(i<=70000))
        mydata=sin(2*pi*f7/Fs*t);
    elseif((i>70000)&&(i<=80000))
        mydata=sin(2*pi*f8/Fs*t);
    elseif((i>80000)&&(i<=90000))
        mydata=sin(2*pi*f9/Fs*t);
    elseif((i>90000)&&(i<=100000))
        mydata=sin(2*pi*f10/Fs*t);
    end
end
stem(mydata)
  • 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-05-29T17:06:08+00:00Added an answer on May 29, 2026 at 5:06 pm

    your code doesn’t do very much; you know that, right?
    if we don’t know/understand what you want, we can’t help..

    and for anyone else: 1 lakh = 100 000 (http://en.wikipedia.org/wiki/Lakh)

    edit: are you trying to produce an array of 100000 samples, consisting of a fixed number of points from different sine waves? aka:

    [sin(1.0*pi*[0:10])  sin(2.0*pi*[0:10] sin(1.5*pi*[0:10] (etc) ]
    

    edit2: you repeated your earlier question (which was already answered): How can I generate a sine wave with different frequencies using matlab?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code for which I want to know if I need
i have the following code ..i need to loop through end of the file
I have the following code that I need to add an additonal object to
I need syntax help with the following code logic: I have a code block
I have the following FORTRAN code which I need to convert to C or
The following code, prints out Derived Base Base But I need every Derived object
The xmlns attribute in the following code stops me getting the value I need.
Evening all. I have the following code that I need looking into - basically
I have the following code in about 300 HTML files, I need to replace
I have the following code and need to check if a value exists as

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.