MATLAB: Save file and plot

average powerchannel modelCommunications ToolboxcountorDSP System ToolboxImage Processing ToolboxlengthMATLAB and Simulink Student Suiteoptical channeloptical communicationoptical distributionoptical poweroptical wirelessoptical wireless commu

I have this code and want to save the "AverPr" value
After that, I want to load it up again and draw it
Please help me
'''''''''''''''''''''''
AverPr=mean(P_rec_dBm);
f=0:0.05:lx;
plot(f,AverPr,'r-*');grid on;
xlabel('x[m]');
ylabel('Average Power Distrbution');

Best Answer

save('file_name' , 'AverPr') ; % this will save your Averpr to a file_name
load('file_name'); % loads back the file
make sure , you don't change the directory while loading the file .