How can I plot first harmonic wave from a wave data (Excel)

조회 수: 6 (최근 30일)
Hesham
Hesham 2023년 3월 22일
답변: Vishwa 2023년 3월 24일
How can I plot first harmonic wave from a wave data (Excel)?
I have the following plot from an excel file data (attached).
I need only a wave plot of 1st harmonic of the main wave (shown above).
Thank you

답변 (2개)

Yash Srivastava
Yash Srivastava 2023년 3월 23일
Hi Hesham,
In my understanding you need to plot data in 'waves.csv' in MATLAB.
For this you can use 'readtable' function to read data in MATLAB and plot the data using 'plot' function.
data=readtable('wave.csv');
plot(data, "Var1", "Var2")
Since no header is provided in .csv file, MATLAB assigns defaultvariable names, "Var1" and "Var2", to the column.
Please refer to the following documentation for more info on 'readtable'.
Thanks
  댓글 수: 1
Hesham
Hesham 2023년 3월 23일
Thank you Yash.
I know how to read data from Excel.
I want to extract the 1st harmonic waveform and plot it from the wave main wave (excel data).

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


Vishwa
Vishwa 2023년 3월 24일
Hi Hesham,
MATLAB provides Curve Fitting Toolbox™ which has a fit type with fourier series. For only fundamental component, you can restrict the number of terms in the dialogue box to just 1.
Following MATLAB documentation might be helpful.
openExample('curvefit/FitFourierModelsInteractivelyInCurveFitterAppExample')
Thanks.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by