How to create new data from old data?

I want to create new data and combine data which has same Alpha with high peak
OldData= [ 0.5 0.6 -0.1 0.2 0.5; ...
0.2 0.3 0.1 0.7 0.6; ...
0.7 0.6 -0.2 0.3 0.4];
OldData =
0.5000 0.6000 -0.1000 0.2000 0.5000 %%%%OldData(1,:) have Alpha=0.6
0.2000 0.3000 0.1000 0.7000 0.6000 %%%%OldData(2,:) have Alpha=0.2
0.7000 0.6000 -0.2000 0.3000 0.4000 %%%%OldData(3,:) have Alpha=0.7
If I assume that OldData(1,:) is one signal, and OldData(2,:) and OldData(3,:) are other signals. How can I combine signal which have alphas more than 0.5, which have the higher peak?
for i=1:3
figure;
OldData(i,:)
if Alpha>0.5
NewData(i,:)=OldData(i,:);
else
NewData(i,:)=0;
end
end
How I combine signal?
Thank you

 Réponse acceptée

Image Analyst
Image Analyst le 24 Avr 2015
Try this:
NewData = zeros(size(OldData));
for k=1:3
figure;
OldData(k,:) % Echo to command window.
if Alpha(k) > 0.5 % Check Alpha for this signal.
NewData(k,:)=OldData(k,:);
end
plot(NewData, 'b*-', 'LineWidth', 2, 'MarkerSize', 12);
end
Of course you must have your Alphas in an array.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by