Plot CDF Graph

 

Sub calculateCDF()
'
' caculateCDF Macro
'

'
     Range("M2").Select
     Selection.EntireRow.Delete
     Do While Range("M2").Value < 1 And Not IsEmpty(Range("M2"))
        Range("M2").Select
        Selection.EntireRow.Delete
     Loop
     
     If IsEmpty(Range("M2")) Then
        Exit Sub
     End If
     Dim row As Integer
     
    row = Range("M2").End(xlDown).row
    
    Do While Cells(row, 13).Value < 1 And Not IsEmpty(Cells(row, 13)) And row > 2
        Cells(row, 13).Select
        Selection.EntireRow.Delete
    Loop
    
        

    
    Range("O1").Select
    ActiveCell.FormulaR1C1 = "Range to plot from"
    Range("O2").Select
    ActiveCell.FormulaR1C1 = "Number of bins"
    Range("O3").Select
    ActiveCell.FormulaR1C1 = "Max of Range"
    Range("O4").Select
    ActiveCell.FormulaR1C1 = "Min of Range"
    Range("O5").Select
    ActiveCell.FormulaR1C1 = "Bin size"
    Range("O7").Select
    ActiveCell.FormulaR1C1 = "Average"
    Range("O8").Select
    ActiveCell.FormulaR1C1 = "Variance"
    Range("O9").Select
    ActiveCell.FormulaR1C1 = "Standard deviation"
    Range("Q1").Select
    ActiveCell.FormulaR1C1 = "wkB/s"
    Range("R1").Select
    ActiveCell.FormulaR1C1 = "SR Disk BW CDF"
 
    Range("P1").Select
    ActiveCell.FormulaR1C1 = "H2:H1502"
    Range("P2").Select
    ActiveCell.FormulaR1C1 = "50"
    Range("P3").Select
    ActiveCell.FormulaR1C1 = "=Max(INDIRECT(R[-2]C))"
    Range("P4").Select
    ActiveCell.FormulaR1C1 = "=MIN(INDIRECT(R[-3]C))"
    Range("P5").Select
    ActiveCell.FormulaR1C1 = "=(R[-2]C-R[-1]C)/R[-3]C"
    Range("P7").Select
    ActiveCell.FormulaR1C1 = "=AVERAGE(INDIRECT(R[-6]C))"
    Range("P8").Select
    ActiveCell.FormulaR1C1 = "=VAR(INDIRECT(R[-7]C))"
    Range("P9").Select
    ActiveCell.FormulaR1C1 = "=STDEV(INDIRECT(R[-8]C))"
    
    Range("Q2").Select
    ActiveCell.FormulaR1C1 = "=R[2]C[-1]"
    Range("Q3").Select
    ActiveCell.FormulaR1C1 = "=R[-1]C+R5C16"
    Range("Q3").Select
    Selection.AutoFill Destination:=Range("Q3:Q52"), Type:=xlFillDefault
    
    Range("R2").Select
    ActiveCell.FormulaR1C1 = _
        "=IF(RC[-1]>=R3C16,1,PERCENTRANK(INDIRECT(R1C16),RC[-1]))"
    Range("R2").Select
    Selection.AutoFill Destination:=Range("R2:R52"), Type:=xlFillDefault
    
    ActiveSheet.Shapes.AddChart.Select
    ActiveChart.SetSourceData Source:=ActiveSheet.Range("$O$1:$R$52")
    ActiveChart.ChartType = xlLine
    ActiveChart.SeriesCollection(2).Delete
    ActiveChart.SeriesCollection(1).Delete
    ActiveChart.SeriesCollection(1).Delete
    ActiveChart.SeriesCollection(1).XValues = "='sr151_sdc'!$Q$2:$Q$52"
    ActiveChart.Legend.Select
    Selection.Delete
    ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
    ActiveChart.ChartTitle.Characters.Text = "SSD SR Disk BW (" & ActiveSheet.Name & ")"
    ActiveChart.Axes(xlCategory).AxisTitle.Select
    ActiveChart.Axes(xlCategory).AxisTitle.Characters.Text = "wkB/s"
   
 End Sub
Sub DrawDiskCDF()
 For Each persheet In ActiveWorkbook.Sheets
     sheetname = persheet.Name
     If sheetname <> "Config" And sheetname <> "requests" And sheetname <> "utilization" And sheetname <> "throughput" Then
        persheet.Select
        persheet.Activate
        calculateCDF
     End If
   Next
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值