subplot random points in color

7 visualizzazioni (ultimi 30 giorni)
anabel atah
anabel atah il 5 Gen 2020
Risposto: Image Analyst il 5 Gen 2020
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

Risposte (1)

Image Analyst
Image Analyst il 5 Gen 2020
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.

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by