フィルターのクリア

How can I correct this error?

1 回表示 (過去 30 日間)
Mallouli Marwa
Mallouli Marwa 2018 年 6 月 8 日
コメント済み: Mallouli Marwa 2018 年 6 月 12 日
Hello
I have done this program , no error is displayed but any curve is displayed.
Can you help me
clc; clear ; close all;
% acceleartion + displacement
cd Z:\Stage\Travail_fait\marwa
load data1; tmp = data1(:,1); disp = data1(:,2); acc = data1(:,3);
figure(1) plot(tmp, acc, 'b',tmp,acc,'r.') xlable('time (s)'); ylabel('Acceleration (ms^(-2))');
  2 件のコメント
Stephan
Stephan 2018 年 6 月 8 日
編集済み: Stephan 2018 年 6 月 8 日
Hi,
your question is a little bit unclear. What is the problem?
clc;
clear ;
close all;
% acceleartion + displacement
cd Z:\Stage\Travail_fait\marwa
load data1;
tmp = data1(:,1);
disp = data1(:,2);
acc = data1(:,3);
figure(1)
plot(tmp, acc, 'b',tmp,acc,'r.')
xlabel('time (s)');
ylabel('Acceleration (ms^(-2))');
The actual code gives you a blue line with the acc over tmp values and additionally red dots from also acc over tmp. Do you want to show disp over tmp instead? Or does your curve not look like it should?
There was just one mistake in
xlable('time (s)');
which should be
xlabel('time (s)');
Please tell your problem a little more exactly. If possible attach data1 file.
Best regards
Stephan
Mallouli Marwa
Mallouli Marwa 2018 年 6 月 10 日
Hi
See Data1 as attached.
I want also to show disp over tmp instead
Thanks for help

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

採用された回答

Stephan
Stephan 2018 年 6 月 11 日
Hi,
to show disp over tmp Change the plot command:
plot(tmp, acc, 'b',tmp,disp,'r.')
which will give you this result:
You could also work with subplots using the following code:
figure(1)
subplot(2,1,1)
plot(tmp, acc, 'b')
xlabel('time (s)');
ylabel('Acceleration (ms^(-2))');
subplot(2,1,2)
plot(tmp, disp, 'b')
xlabel('time (s)');
ylabel('Displacement');
Which gives you:
Best regards
Stephan
  2 件のコメント
Mallouli Marwa
Mallouli Marwa 2018 年 6 月 12 日
Thanks
Mallouli Marwa
Mallouli Marwa 2018 年 6 月 12 日
I have added this part in the program that calculate the Fourier
Transform of the voltage but the trend is not well.
The curve FRF wanted attached is the best trend.
So How can I ameloirate the trend of this FRF found (figure3 in the program).
The program is:
%% %script traitement signal %objet : traitement signal MPF clc; clear; close all; cd Z:\Matlam\Curves_oscillo_Pc %%
%% load 'data1.txt';
tmp = data1(:,1);
disp = data1(:,2);
acc = data1(:,3);
figure(1)
plot(tmp,acc,'b',tmp,acc,'r.');
xlabel('time (sec)');
ylabel('Acc (ms^{-2})');
%on récupère les données de Oscilloscope en Volt
load 'data1V.txt';
tmpV = data1V(:,1);
Volt = data1V(:,2);
%Voltb = 40e-3*ones(size(tmpV));
figure(2)
plot(tmpV,Volt,'b',tmpV,Volt,'r.');
xlabel('time (sec)');
ylabel('Voltage(V)'); %%
L=length(tmp)
Lv=length(tmpV)
Fs = 5000; % Sampling frequency
NFFT = 2^nextpow2(L) % Next power of 2 from length of y
NFFTV = 2^nextpow2(Lv) % Next power of 2 from length of y
figure(3)
VOLT = fft(Volt,NFFT)/L; % Calcul de la FFT
amplitude = 2*abs(VOLT(1:NFFT));
f = Fs/2*linspace(0,1,NFFT/2);
semilogy(f(1:NFFT/12),2*abs(VOLT(1:NFFT/12)))
xlabel('frequency')
ylabel('FRF Volatage')

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by