ploting electric field versud time

1 回表示 (過去 30 日間)
Jasmine
Jasmine 2023 年 3 月 6 日
回答済み: Askic V 2023 年 3 月 6 日
Can you please give me the code for plotting the attached txt file.Also I need to plot its fourier transform as well.

回答 (1 件)

Askic V
Askic V 2023 年 3 月 6 日
This is how can you read the contents of the file into variables.
data_file = websave('phi_theta.txt','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1315990/phi=0%20and%20theta=10.txt')
data_file = '/users/mss.system.bjiTpz/phi_theta.txt'
fid = fopen('phi_theta.txt')
fid = 3
datacell = textscan(fid, '%f %f','CommentStyle','#');
var1 = datacell{1};
var2 = datacell{2};
plot(var1, var2)
Regarding the fft, please have a look at the Matlab documentation:
https://www.mathworks.com/help/matlab/ref/fft.html

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by