I am a novice to matlab...so helpl me out... I get a message Error: "identifier" expected, "end of line" found. when I run the code...could some one please let me know what is it i am doing wrong... n = 4; % Path Loss Exponent for the Model sigma = 6; % Standard deviation d0 = 1; % Reference Distance from MS (Meters) Prd0 = 0; % Received Power at d0 distance from MS (dBm) Prmin = - 118; % Minimum Received Power for MS (dBm) PrHO = - 112; % Hand Off Threshold Power for MS (dBm) D = 1600; % Total Distance between BS 1 and BS 2 (Meters) count = 0; c = 1 : 100 :1600; for d = 1 : 100 : 1600 % Distance from 1 m to 1600 m count = count +1 ; Power_BS1_dBm (count) = (Prd0 - (10 * n * log10( d/d0 ) ) ); % Received Power at BS1 from MS Power_BS2_dBm (count) = (Prd0 - (10 * n * log10( (D-d)/d0 ) ) ); % Received Power at BS2 from MS end
No.1 | | 1212 bytes | |
Sam wrote: > > I am a novice to matlab...so helpl me out... > I get a message Error: "identifier" expected, "end of line" found. > when I run the code...could some one please let me know what is it > i > am doing wrong... > > n = 4; % Path Loss Exponent for the Model > sigma = 6; % Standard deviation > d0 = 1; % Reference Distance from MS (Meters) > Prd0 = 0; % Received Power at d0 distance from MS (dBm) > Prmin = - 118; % Minimum Received Power for MS (dBm) > PrHO = - 112; % Hand Off Threshold Power for MS (dBm) > D = 1600; % Total Distance between BS 1 and BS 2 (Meters) > count = 0; > c = 1 : 100 :1600; > for d = 1 : 100 : 1600 % Distance from 1 m to 1600 m > count = count +1 ; > Power_BS1_dBm (count) = (Prd0 - (10 * n * log10( d/d0 ) ) ); > % > Received Power at BS1 from MS > Power_BS2_dBm (count) = (Prd0 - (10 * n * log10( (D-d)/d0 ) ) > ); > % Received Power at BS2 from MS > end >
you _have_ to indicate in which line above the error occurs and then someone may be able to help you out ..
Jos
No.2 | | 272 bytes | |
Error is here: -- Power_BS1_dBm (count) = (Prd0 - (10 * n * log10( d/d0 ) ) );% Received Power at BS1 from MS -- Just put "Received Power at BS1 from MS" to the upper line. Otherwise it will NOT be considered as a *comment*. Regards, - Taha
No.3 | | 109 bytes | |
I figured it out...the name of my file was not correct. It had two dots '..' Example: math..m