clear
load 'strain_constant_t2 (15000 data).dat' %t2_data,dat is the data file in the ASCII format
strain_constant_t2
pause
%time series parameters
x=strain_constant_t2;
N=15000; %sampling points at 15000
fs=500; %sampling frequency at 500hz
T=1/fs;
ts=N/fs;
t=ts/N:ts/N:ts;
plot(t,x);
ylabel('Amplitude [microstrain]');
xlabel('Time [seconds]');
this code didnt show any error. somehow it still not showing up the plot graph after i run it.

2 件のコメント

VBBV
VBBV 2023 年 8 月 7 日
can you share the data file?
Mohamad Hanafi Md Rasol
Mohamad Hanafi Md Rasol 2023 年 8 月 7 日
@VBBV you want the .dat file?

サインインしてコメントする。

 採用された回答

Dyuman Joshi
Dyuman Joshi 2023 年 8 月 7 日

0 投票

I assume that you are running a script by pressing the run button (or typing the script name in command window).
The pause command has paused all the operations of the code until you press a key to continue. Any code after the pause command will only be executed after you unpause by pressing a key. (You can check this by looking at the workspace, it will not have the variables you have defined in your code)
Remove the pause command. If you want to keep the pause command, pause for a limited time.
Your code runs fine here. I have commented out the pause command -
x = readmatrix('Strain 15000 data.xlsx'); %t2_data,dat is the data file in the ASCII format
%pause
%time series parameters
N=15000; %sampling points at 15000
fs=500; %sampling frequency at 500hz
T=1/fs;
ts=N/fs;
t=ts/N:ts/N:ts;
plot(t,x);
ylabel('Amplitude [microstrain]');
xlabel('Time [seconds]');

1 件のコメント

Mohamad Hanafi Md Rasol
Mohamad Hanafi Md Rasol 2023 年 8 月 7 日
@Dyuman Joshi Thank you for your help sir. I appreciate it so much.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by