- #1
milo0s
- 4
- 0
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
6001 -- 10000 0.20
10001 -- 20000 0.23
20001 -- 40000 0.25
40001 and over 0.26
Now 20 or so users have their usage recorded and saved in the file called usage.dat,
And you are asked to use Matlab to calculate the amount each user needs to pay for
his/her electricity bill.
Aim:
Practice in using Matlab for the following functionality.
• Load data from files.
• Use FOR to form loop structure.
• Use IF … ELSE to form selection structure.
• Save data into files.
thankx in advance
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
6001 -- 10000 0.20
10001 -- 20000 0.23
20001 -- 40000 0.25
40001 and over 0.26
Now 20 or so users have their usage recorded and saved in the file called usage.dat,
And you are asked to use Matlab to calculate the amount each user needs to pay for
his/her electricity bill.
Aim:
Practice in using Matlab for the following functionality.
• Load data from files.
• Use FOR to form loop structure.
• Use IF … ELSE to form selection structure.
• Save data into files.
thankx in advance