I want to fill these 15 equal zones with the different %age value and these values to be depicted by color scale
Mostra commenti meno recenti
N = 4; % divides to 4 parts N1 = 10;
a = linspace(0, 2*pi, N*10);
a1 = linspace(0,2*pi, N1*10);
r1 = 100;
r2=58;
r3=25;
x = r1*cos(a1);
y = r1*sin(a1);
x1 = r2*cos(a1);
y1 = r2*sin(a1);
x2 = r3*cos(a);
y2 = r3*sin(a);
figure(1)
plot(x, y,'k')
hold on
plot([x1(1:10:end);x(1:10:end)], [y1(1:10:end);y(1:10:end)])
hold on
x1 = r2*cos(a);
y1 = r2*sin(a);
plot(x1, y1,'r')
plot([x2(1:10:end); x1(1:10:end)], [y2(1:10:end); y1(1:10:end)])
plot(x2, y2,'b')
hold off
axis equal
Risposte (1)
Ayush Bansal
il 29 Ott 2020
1 voto
9 Commenti
AASHNA SUNEJA
il 29 Ott 2020
Ayush Bansal
il 30 Ott 2020
For reference check out matlab script.
AASHNA SUNEJA
il 30 Ott 2020
Ayush Bansal
il 30 Ott 2020
I have run the file and it's working fine. check the path, disk drive or check for the function file installation.
For values input either use input(prompt) function to get user input data. Or create app with edit box to take input and associate a callback to edit box to change area color in the figure.
AASHNA SUNEJA
il 31 Ott 2020
Ayush Bansal
il 2 Nov 2020
polyshape function cretaes the polygon.
Use experimental_value(i)=input(["experimental values for polygon " num2str(i)]) for getting user input experimental values for the ith polygon.
Use c=colormap(experimental_value) to get a RGB color array for the experimental value. Make sure you map experimental values to 1-n, i.e. max experimental value maps to n and min experimental value maps to 1, where n is the input given to jet function.
Plotting the polygon creates a polygon object. Use polygon object property FaceColor to assign the color genertated by colormap(experimental_value). Also set the FaceAlpha property of polygon object to 1 to make sure polygon is not transparent.
Repeat this for the number of polygons figure has.
AASHNA SUNEJA
il 4 Nov 2020
Ayush Bansal
il 4 Nov 2020
Assign the mapped experimental values to the FaceColor property of the polygon object, which will change the polygon color. Additionally change the label of colormap by setting yticklabel using set function.
Refer to the attached script.
AASHNA SUNEJA
il 6 Nov 2020
Categorie
Scopri di più su Image Thresholding in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!