summaryrefslogtreecommitdiff
path: root/3871/CH9/EX9.2/Ex9_2.sce
blob: 7febc3cd67c88a12e4cc617eaa422d336469ddd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//===========================================================================
//chapter 9 example 2

clc;clear all;

//variable declaration
R   = 4;     //digital counter reading
G    = 0.001;    //gatting period in s
T     = 150;     //number of teeth on rotor 

//calculations
f   = R/(G);    //number of pulses per second 
N    = (f/T)*60;     //rotational speed in rpm

//result
mprintf("rotational speed = %3.2f rpm",N);