Recent content by milo0s

  1. M

    MATLAB MATLAB Loop & Electricity Billing Help

    when ever i do for n=1:20 it loops n 20 times and multiplies it by .15 each time which results in a vector from 1 to 3 this is what i put together which seems to work clear all %Removes all variables, functions, and MEX-files from memory, leaving the workspace empty...
  2. M

    MATLAB MATLAB Loop & Electricity Billing Help

    hey guys is this right?clear all clc u=load('usage.dat')'; for u=u for u=u if u<1001 c=u*.15; elseif u<3001 c=1000*.15+(u-1000)*.17; elseif u<6001 c=1000*.15+2000*.17+(u-2000-1000)*.18; elseif u<10001 c=1000*.15+2000*.17+(u-3000-2000-1000)*.2; elseif u<20001...
  3. M

    MATLAB MATLAB Loop & Electricity Billing Help

    i managed to do the loop but how would you go about saving your answers as a vector
  4. M

    MATLAB MATLAB Loop & Electricity Billing Help

    hey guys I am new to MATLAB and cannot get my head around the whole loop thing my problem is : An electricity distribution company has different rates of charges on electricity used based on the usage as follows. Usage in KWH $ / KWH 0 -- 1000 0.15 1001 – 3000 0.17 3001 -- 6000 0.18...
Back
Top