Navigation :
Top/MATLAB Practice 6
MATLAB Practice 6
- 追加された行はこの色です。
- 削除された行はこの色です。
- MATLAB Practice 6 へ行く。
- MATLAB Practice 6 の差分を削除
#author("2022-06-06T12:43:37+09:00","default:mori","mori") #author("2022-06-06T12:48:02+09:00","default:mori","mori") *Read/write data + Fourier analysis [#ided5637] - Read the -.mat data 'crf_wind.mat' and plot the first row component [u(1,:)]. - Read the .mat data 'crf_wind.mat' and plot the first row component [u(1,:)]. u is the wind speed data and the dimension is [m/s], the horizontal axis is time, the increment is dt, and the dimension is [s]. # load - Load the text data 'crf_wind.dat', plot the first row component [u(1,:)], and compare it with u(1,:) in the .mat data. The data format of 'crf_wind.dat' is in Appendix 1. # fopen, fscanf, fclose Calculate the spectrum of -u(1,:) and plot it on the logarithmic axis. # logloglog - Save the computed values in matlab format # save *Data [#qae49bf7] - [[Text data>Home:files/education/crf_wind.dat]] - [[Matlab binary data>Home:files/education/crf_wind.mat]] Ref. % Output format of crf_wind.dat filename_tmp = strcat('filename_w','.dat') fid = fopen( 'crf_wind.dat', 'w' ) fprintf( fid, '%5d %5d\n', nt, nz ) fprintf( fid, '%12.5e\n', dt ) fprintf( fid, '%12.5e', z(1:nz) ) fprintf( fid, '\n' ); for iz=1:nz fprintf( fid, '%12.5e', u(iz,:) ); for iz=1:nz fprintf( fid, '\n' ); end fclose(fid);