subplot random points in color

조회 수: 7 (최근 30일)
anabel atah
anabel atah 2020년 1월 5일
답변: Image Analyst 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