help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help!!


From: Doug Stewart
Subject: Re: Help!!
Date: Sun, 3 May 2015 06:45:56 -0400



On Sun, May 3, 2015 at 2:47 AM, 배원민 <address@hidden> wrote:

Hi, I'm having trouble with octave and i need your help.

 

for s=1:1:5;
data="">count=0;
for i=[10 22 33 44 45 56 57 58 59 60 61]
 count=count+1; 
 d_i=data(data(:, 1)==i ,:);

 j=1:25;
 k_j=3*j-2;
 y_j=3*j-1;
 x_j=3*j;
 d_k=[d_i(k_j,2),d_i(y_j,2),d_i(x_j,3)];
 x=d_k(s,1);
 y=d_k(s,2);
 z=d_k(s,3);

 a(count)=x;
 b(count)=y;
 c(count)=z;
end
w=[a; b; c];
q=sortrows(w', 1);
u=q(:,1);
v=q(:,2);
r=q(:,3);

subplot(2,2,1);
plot(u,v);
title('node point velocity');
subplot(2,2,3);
plot(u,r);
title('node point pressure');

x_int=[0:0.228111:6.8433336];
y_int=interp1(u,v,x_int);
z_int=interp1(u,r,x_int);

subplot(2,2,2);
plot(x_int,y_int);
title('fixed point velocity');
subplot(2,2,4);
plot(x_int,z_int);
title('fixed point pressure');

k=6*e^(-7);
H=20;
t=0.1;
d=y_int.*z_int*t*k/H;
d(isnan(d)) = 0;

m=sum(d)

 change m=sum(d)

to
m(s)=sum(d);
m
m'



end

>> final
m = -0.0049338
m = -0.0058300
m = -0.0066657
m = -0.0074801
m = -0.0082973

 

but, I want to know how to merge for-loop(for s=1:1:5;) data for one matrix. like this:
m = -0.0049338  -0.0058300  -0.0066657  -0.0074801  -0.0082973

 

Could you give me some solutions for this problem?

 

 


_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave




--
DASCertificate for 206392


reply via email to

[Prev in Thread] Current Thread [Next in Thread]