how to insert rand noise for this?

조회 수: 2 (최근 30일)
hafis radzi
hafis radzi 2019년 3월 11일
댓글: hafis radzi 2019년 3월 11일
filename = 'hafis.CSV';
M = csvread(filename);
N=100;
x=M(:,3);
Y=M(:,4);
N=100;
subplot(2,2,1)
plot (x,Y,'linewidth',2)
title('Arc Signal')
xlabel('TIME')
ylabel('VOLTAGE');

채택된 답변

Adam Danz
Adam Danz 2019년 3월 11일
편집: Adam Danz 2019년 3월 11일
You can use rand() to produce a vector (or matrix/array) of random values between 0:1. I subtracted 0.5 from those random numbers to center them around 0. Then I scaled them by a factor of 2 to demonstrate how to scale the random noise. Then simply add the noise to your data.
xrand = (rand(size(x))-0.5) * 2;
yrand = (rand(size(Y))-0.5) * 2;
plot (x + xrand, Y + yrand, 'linewidth', 2)
By the way, you defined N twice in your code.
  댓글 수: 1
hafis radzi
hafis radzi 2019년 3월 11일
i already got it sir,tq.

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by