subplot random points in color
7 ビュー (過去 30 日間)
古いコメントを表示
I have this function
function [I]= fick_diffusion(D, Cin,Cout,dist)
I = -D*((Cin-Cout)/dist)
end
I have all this parameters:
D= 2.1*10^-5
A = 30*40
Nin=20
Nout=0
dist = 40
while Nin>=10
[I] = fick_diffusion(D,Nin/A,Nout/A,dist)
Num_moving_part = -round(Nin*I*10^7)+2
Num_moving_location = randperm(Nin,Num_moving_part)
I need to find random location for the Num_moving_part when Nin and Nout are equal and there are only 20N together
and I need to subplot every move of the N and in a differnt color until in both side there are 10 N

0 件のコメント
回答 (1 件)
Image Analyst
2020 年 1 月 5 日
When you go to plot a marker on your plots, choose a random color:
randomColor = rand(1, 3);
hold on;
plot(x, y, '.', 'Color', randomColor, 'MarkerSize', 30);
where x and y are scalars for just one point. This will plot all spots/markers in a different random color.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!