subplot random points in color

7 次查看(过去 30 天)
anabel atah
anabel atah 2020-1-5
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

回答(1 个)

Image Analyst
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.

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by