MATLAB Answers

Onramp problem 14.1 and 14.2 plotting problems

32 views (last 30 days)
heidi burgess
heidi burgess on 17 Feb 2021
Commented: heidi burgess on 1 Mar 2021
On both of these examples I have inputted the correct code - when compared to the answer. However in both examples it still says that I have an incorrect code. What am I doing wrong? (there are four lines on the plot, s is on the y axis, and it is dashed!!
  3 Comments
heidi burgess
heidi burgess on 1 Mar 2021
Thank you for getting back to me. I have had this problem a couple of times now with the onramp and the fundimentals. However, it seems that the system keeps something in its memory, so if i press the reset question button (which clears everything) then reput in the exact same code (using copy paste) it then works. Seems to be just a frustrating little bug - but might be worth making a bigger thing of the reset button so that folks know to use it.
Thanks
Heidi

Sign in to comment.

Answers (1)

ANKUR KUMAR
ANKUR KUMAR on 26 Feb 2021
Few points I need to mention:
1) You are calculating R1_av as a function of u, so if you use the below chunk of code, it will plot the values of R1_av.
plot(1:p, R1_av, 'linewidth', 1.5); hold on; grid on;
2) I am amaze that why you wish to plot R1_av as a function of d1. d1 is Distances of users from base station. You are using the same variable in line 3 and line 6. Never do that. Never assign the pre assigned variable in a loop iterated variable, as it is not a good practice and hard to debug the code.
  2 Comments
ANKUR KUMAR
ANKUR KUMAR on 26 Feb 2021
Why do you wish to plot d1 vs R1_av? Both are having different dimension, and that is why it is NOT possible to plot both. If still you wish to plot these two, you need to modify the code. First try to understand which variable R1_av dependent on? Dimension of both x and y variable MUST be same.

Sign in to comment.

Tags

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!