Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
how to use data from .m file into another?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
sayantani  
View profile  
 More options Feb 10, 7:27 pm
Newsgroups: comp.soft-sys.matlab
From: "sayantani " <saya.to...@gmail.com>
Date: Sat, 11 Feb 2012 00:27:11 +0000 (UTC)
Local: Fri, Feb 10 2012 7:27 pm
Subject: how to use data from .m file into another?
In the following code,i need 1 lakh samples in the array mydata.I dont 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]; %output array
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)

please help me. thank you


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dpb  
View profile  
 More options Feb 11, 2:49 pm
Newsgroups: comp.soft-sys.matlab
From: dpb <n...@non.net>
Date: Sat, 11 Feb 2012 13:49:44 -0600
Local: Sat, Feb 11 2012 2:49 pm
Subject: Re: how to use data from .m file into another?
On 2/10/2012 6:27 PM, sayantani wrote:

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

What is a lakh?

...

> ....how can i use the data in mydata into another .m file
> for further processing.

Pass the result back as the result of the function to the calling
function/workspace.

Read "Getting Started" on Programming, m-files, etc., etc., ...

> t = [ 1 : 1 : 500]; % Time Samples
> f1=10000; % Input Signal Frequency
> f2=20000;
> f3=30000;
> f4=f2+f3;
> f5=f1+f3;
> f6=f4+f2;

...

See response today on yesterday's thread on generating data "according
to sine function with changing period".  Gives example w/ a set of fixed
frequencies; yours is no different other than the combination
frequencies in addition.

--


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »