a question about plotting
Show older comments
Q.
I have many S seperately with different on lines on the plot, lines with different k have different colours and shapes. I change the coding to make it more efficient, but now I have no idea how to have a same plot of my original one.
1/ my original codes for S and k, and my original plotting codes
I = 1:100
k03 = 0.3
k1 = 1
k3 = 3
k5 = 5
k8 = 8
k13 = 13
k15 = 15
k18 = 18
k23 = 23
k25 = 25
k28 = 28
S03F = k03*log(I)
S1F = k1*log(I)
S3F = k3*log(I)
S5F = k5*log(I)
S8F = k8*log(I)
S13F = k13*log(I)
S15F = k15*log(I)
S18F = k18*log(I)
S23F = k23*log(I)
S25F = k25*log(I)
S28F = k28*log(I)
figure(1)
hold on
plot(S03F,'co-','markersize',3,'Displayname','k<1');
plot(S1F,'gs-','markersize',3,'Displayname','k=1');
plot(S3F,'gs-','markersize',3,'Displayname','k=3');
plot(S5F,'gs-','markersize',3,'Displayname','k=5');
plot(S8F,'gs-','markersize',3,'Displayname','k=8');
plot(S13F,'md-','markersize',3,'Displayname','k=13');
plot(S15F,'md-','markersize',3,'Displayname','k=15');
plot(S18F,'md-','markersize',3,'Displayname','k=15');
plot(S23F,'rp-','markersize',3,'Displayname','k=23');
plot(S25F,'rp-','markersize',3,'Displayname','k=25');
plot(S28F,'rp-','markersize',3,'Displayname','k=28');
title({'Stevens Law:Power Function'...
'\fontsize{9}Relaitionship Between Subjective and Actual Stimulus Magnitude'...
'\fontsize{9}\color{blue} Under Various k Value'});
lgd = legend ('Location','northwest');
lgd.NumColumns = 4;
lgd.FontSize = 6;
hold off
2. the codes now for S and k
I = 1:100;
kV = [0.3;1;3;5;8;13;15;18;23;25;28];
SV = kV.*log(I)
Accepted Answer
More Answers (0)
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!