Hello,(adsbygoogle = window.adsbygoogle || []).push({});

I am new to Matlab and got a question to ask.

I have created a .m file which plots a cosine graph.

For simplicity, say

time=0:T/999:T;

x=cos(2*pi*time);

plot(time,x);

Then this will create a plot with cos(2piT) with domain of 0~T.

I will like to export this to other .m file so the file can read this graph and calculate the frequency of graph.

But I'm stuck as how I can export this graphical data to other .m file.

Because if I just lookup data on x, it will just give out an array of 1000 values and not knowing its domain(time), I can not calculate the frequency.

Hope this makes sense.

Will appreciate your helps!

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Question on Matlab

**Physics Forums | Science Articles, Homework Help, Discussion**