I want to plot a sine wave from a data array.

조회 수: 3 (최근 30일)
Mehrdad Kazemtabrizi
Mehrdad Kazemtabrizi 2020년 2월 13일
댓글: Mehrdad Kazemtabrizi 2020년 2월 14일
Hi,
I have a mat file which is full of data extracted from a sine wave. Now, I want to plot one based on this data. How can I do it in MATLAB?
  댓글 수: 1
Guillaume
Guillaume 2020년 2월 13일
You're going to have to give a lot more details.
A mat file contains variables, so firstly it's unclear what a mat file full of data extracted from a sine wave actually means.
Then it's unclear what one is in I want to plot one.

댓글을 달려면 로그인하십시오.

답변 (1개)

Ashitha Mahendra
Ashitha Mahendra 2020년 2월 14일
Hi Mehrdad,
I am assuming that you want to plot a specific variable stored in MAT-file.
My suggestion would be:
1. Since, you cannot plot a mat file directly, you have to load the data to the MATLAB workspace first. For this, you can execute something like the following example:
Data = load('Sine.mat'); % replace 'Sine.mat' with the name of your MAT-file
2. Now you can plot the data, perhaps using the following command:
plot(Data.spec);
where "spec" can be replaced with the variable which you want to plot.
Hope this helps.
  댓글 수: 1
Mehrdad Kazemtabrizi
Mehrdad Kazemtabrizi 2020년 2월 14일
Thanks for the answer. I know the question was vague and I apologize.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by