Plotting different colored marker points for 4 seperate data entries
显示 更早的评论
Hello, for an assignment I must calculate the reynold's number given multiple different inputs and output a plot of the temperature versus reynolds number for four different fluid velocity inputs. My code is as given
function [] = reynoldsnumber(InitialT, FinalT, Tinc, InitialV, FinalV,Vinc, FluidDensity, PipeDiameter, ActivationE, EntropicFactor)
R= .008314; Ts=InitialT+273.15; Tf=FinalT+273.15; Ti=Tinc; Vs=InitialV; Vf=FinalV; Vi=Vinc; FD=FluidDensity; PD=PipeDiameter; AE=ActivationE; EF=EntropicFactor; T = [Ts:Ti:Tf]; V = [Vs:Vi:Vf]; i=0; while i<=4; for V = Vs:Vi:Vf for T = Ts:Ti:Tf
i = i+1;
Mu = exp((EF+(AE./(R.*T))));
RN = (FD.*V.*PD)./Mu
LineNum(i)= plot (T,RN,'.','MarkerSize',10);
hold all
end
end
end
xlabel('Temperature (K)') ylabel('Reynold''s number') title('Reynold''s Number Versus Temperature for Varying Fluid Velocities') legend('Linenum1', 'Linenum2', 'Linenum3', 'Linenum4', 'Location', 'NorthWest')
end
My problem is that this plots my marker points with the color varying by "column" of data rather than by each curve of points having different colors. I tried using a while loop so that each iteration of my for loop would change but it had the same result. My final plot looks like this.

Any advice?
Thanks
1 个评论
Ali
2017-10-29
if true
--------------------------------------------------- code start
This is an example for your case
Input is "Input_Data", two dimension matrix
Marker_Counter=1;
figure6=figure;
Markers = {'+','o','*','x','v','d','^','s','>','<'};
for i=1:10:size(Input_Data,1)
TPR=Input_Data(i:i+9,7);
FPR=Input_Data(i:i+9,8);
plot(FPR,TPR,strcat('-',Markers{Marker_Counter}));
Marker_Counter=Marker_Counter+1;
hold on
end
plot([0.5 1],[0.5 1],'--');
legend('Minpts = 100','Minpts = 200','Minpts = 300','Minpts = 400','Minpts = 500','Minpts = 600','Minpts = 700','Minpts = 800','Minpts = 900','Minpts = 1000','','Location','SouthEast');
xlabel('FPR or (1-Specificity)','FontSize',12,'FontWeight','bold'); ylabel('TPR or Spensitivity)','FontSize',12,'FontWeight','bold');
title('ROC Space');
close(gcf);
-------------------------------------------- code end
end
--------------------------------------- picture link preview

采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Electromechanical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!