×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

read data. dat

read data. dat

read data. dat

(OP)
I'm doing the reading of a file. DAT, need to read the columns and make some calculations, my concern is this, each column are values of speed, these values will either increase or decrease up to a nearly constant value,
Almost constant, because when it reached steady state, the values fluctuate slightly neighborhood of a constant value that would be the stable speed, but there is no tendency to grow or decline (line with zero slope).
Now I must read the data from the position it reaches the constant speed of calculations,
One idea was to calculate a slope when the slope is zero, this would be the rate constant value ... start reading the data for the calculations, but when it comes to the stable state or whether it varies slightly from one point to another, the slope can be positive or be negative, but neighborhood of a point,
I do not know how to read the data properly

thanks!

m=csvread('LES9.dat', 1, 0); % Read data

unums = [2 3 5 6 7 8 9 10 11 12 4 13 14 16 17 18 19 20 21 22 23 15];

% I'd like to start reading each column from reaching a nearly constant velocity.

for i = 1:length(unums)
un = unums(i);
u(:,i) = m(:,un);

Y=abs(fft(u(:,i)))/length(u);

n=length(Y);

power(:,i) = abs(Y(1:floor(n/2))).^2/;
nyquist = 1/2;
freq = ((1:n/2)/(n/2)*nyquist)';


% regresion de todos los puntos
[a0,a1]=Linear_regression(log10(freq),log10(power(:,i)));

%a1 = -5/3; % para que la linea tenga pendiente definida
%a0 = log10(power(3000,i)) - (-5/3)*log10(freq(3000));% usando el dato medio
powerfit(:,i) = 10.^(a0 + a1*log10(freq));%reg todo.


a0_matriz(i) = a0;
a1_matriz(i) = a1
M=a1_matriz';

B=(1-i)/10; % indica la altura en metros do ponto de monitoreamento no Riser


% PLOT HORIZONTAL IMPAR %

if i<12 && mod(i,2)==1
subplot(2,6,(i/2+0.5));
loglog(freq,power(:,i),'b',freq,powerfit(:,i),'k:');
L2 = ['h = ' num2str(-B) ' m'];
L3 = ['m = ' num2str(a1,3)];
title({L2;L3},'FontSize',8);
%axis tight;
elseif i>=12 && mod(i,2)==0
subplot(2,6,(i/2+1));
loglog(freq,power(:,i),'b',freq,powerfit(:,i),'k:');
%L2 = ['h = ' num2str(-B) ' m'];
L3 = ['m = ' num2str(a1,3)];
title({L3},'FontSize',8);
%axis tight;

%set(gca,'xtick',[],'ytick',[])
[ax1,h1]=suplabel('super X label');
[ax2,h2]=suplabel('super Y label','y');
%set(h1,'\bf','FontSize',15);
H=labelEdgeSubPlots('\fontsize{14}\bf\kappa (Hz)','\fontsize{12}\bfEnergia (J)',1);

end

end

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close