Info
此问题已关闭。 请重新打开它进行编辑或回答。
How to put this information is a table?
1 次查看(过去 30 天)
显示 更早的评论
Hey I was wondering what command I would need to use to put all of this produced data in table or chart?
%Number 1 and 2
clear;
x0=[42;0;95];
extinct=0;
W=zeros(1,200);
for N= 1:10
F=2*rand(1);
for t=1:200;
W(t)=F;
A=[0 0 F; .6 0 0; 0 .75 .55];
x=(A^t)*x0;
if (sum(x)<1);
extinct=extinct+1;
break;
end
end
end
fprintf('#2 Number of extinction events for N=10 n=%d\n', extinct)
clear;
x0=[42;0;95];
extinct=0;
W=zeros(1,200);
for N= 1:20
F=2*rand(1);
for t=1:200;
W(t)=F;
A=[0 0 F; .6 0 0; 0 .75 .55];
x=(A^t)*x0;
if (sum(x)<1);
extinct=extinct+1;
break;
end
end
end
fprintf('#2 Number of extinction events for N=20 n=%d\n', extinct)
clear;
x0=[42;0;95];
extinct=0;
W=zeros(1,200);
for N= 1:50
F=2*rand(1);
for t=1:200;
W(t)=F;
A=[0 0 F; .6 0 0; 0 .75 .55];
x=(A^t)*x0;
if (sum(x)<1);
extinct=extinct+1;
break;
end
end
end
fprintf('#2 Number of extinction events for N=50 n=%d\n', extinct)
clear;
x0=[42;0;95];
extinct=0;
W=zeros(1,200);
for N= 1:100
F=2*rand(1);
for t=1:200;
W(t)=F;
A=[0 0 F; .6 0 0; 0 .75 .55];
x=(A^t)*x0;
if (sum(x)<1);
extinct=extinct+1;
break;
end
end
end
fprintf('#2 Number of extinction events for N=100 n=%d\n', extinct)
clear;
x0=[42;0;95];
extinct=0;
W=zeros(1,200);
for N= 1:200
F=2*rand(1);
for t=1:200;
W(t)=F;
A=[0 0 F; .6 0 0; 0 .75 .55];
x=(A^t)*x0;
if (sum(x)<1);
extinct=extinct+1;
break;
end
end
end
fprintf('#2 Number of extinction events for N=200 n=%d\n', extinct)
clear;
x0=[42;0;95];
extinct=0;
W=zeros(1,200);
for N= 1:500
F=2*rand(1);
for t=1:200;
W(t)=F;
A=[0 0 F; .6 0 0; 0 .75 .55];
x=(A^t)*x0;
if (sum(x)<1);
extinct=extinct+1;
break;
end
end
end
fprintf('#2 Number of extinction events for N=500 n=%d\n', extinct)
回答(1 个)
sixwwwwww
2013-12-2
编辑:sixwwwwww
2013-12-2
Dear Todd, just do as follows:
count = 1;
%Number 1 and 2
x0=[42;0;95];
extinct=0;
W=zeros(1,200);
for N= 1:10
F=2*rand(1);
for t=1:200;
W(t)=F;
A=[0 0 F; .6 0 0; 0 .75 .55];
x=(A^t)*x0;
if (sum(x)<1);
extinct=extinct+1;
break;
end
end
Matrix(count, 1) = N;
Matrix(count, 2) = extinct;
count = count + 1;
end
fprintf('#2 Number of extinction events for N=10 n=%d\n', extinct)
x0=[42;0;95];
extinct=0;
W=zeros(1,200);
for N= 1:20
F=2*rand(1);
for t=1:200;
W(t)=F;
A=[0 0 F; .6 0 0; 0 .75 .55];
x=(A^t)*x0;
if (sum(x)<1);
extinct=extinct+1;
break;
end
end
Matrix(count, 1) = N;
Matrix(count, 2) = extinct;
count = count + 1;
end
fprintf('#2 Number of extinction events for N=20 n=%d\n', extinct)
x0=[42;0;95];
extinct=0;
W=zeros(1,200);
for N= 1:50
F=2*rand(1);
for t=1:200;
W(t)=F;
A=[0 0 F; .6 0 0; 0 .75 .55];
x=(A^t)*x0;
if (sum(x)<1);
extinct=extinct+1;
break;
end
end
Matrix(count, 1) = N;
Matrix(count, 2) = extinct;
count = count + 1;
end
fprintf('#2 Number of extinction events for N=50 n=%d\n', extinct)
x0=[42;0;95];
extinct=0;
W=zeros(1,200);
for N= 1:100
F=2*rand(1);
for t=1:200;
W(t)=F;
A=[0 0 F; .6 0 0; 0 .75 .55];
x=(A^t)*x0;
if (sum(x)<1);
extinct=extinct+1;
break;
end
end
Matrix(count, 1) = N;
Matrix(count, 2) = extinct;
count = count + 1;
end
fprintf('#2 Number of extinction events for N=100 n=%d\n', extinct)
x0=[42;0;95];
extinct=0;
W=zeros(1,200);
for N= 1:200
F=2*rand(1);
for t=1:200;
W(t)=F;
A=[0 0 F; .6 0 0; 0 .75 .55];
x=(A^t)*x0;
if (sum(x)<1);
extinct=extinct+1;
break;
end
end
Matrix(count, 1) = N;
Matrix(count, 2) = extinct;
count = count + 1;
end
fprintf('#2 Number of extinction events for N=200 n=%d\n', extinct)
x0=[42;0;95];
extinct=0;
W=zeros(1,200);
for N= 1:500
F=2*rand(1);
for t=1:200;
W(t)=F;
A=[0 0 F; .6 0 0; 0 .75 .55];
x=(A^t)*x0;
if (sum(x)<1);
extinct=extinct+1;
break;
end
end
Matrix(count, 1) = N;
Matrix(count, 2) = extinct;
count = count + 1;
end
fprintf('#2 Number of extinction events for N=500 n=%d\n', extinct)
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!