Error using plot Undefined function or variable 'newplot'.
조회 수: 15 (최근 30일)
이전 댓글 표시
Hi,
I am using Matlab via Citrix. I am getting the following error while using plot function.
Error using plot in line 30
Undefined function or variable 'newplot'.
% Jake's Method
% close all;
clear all;
N=30;
M=0.5*(N/2-1);
wn(M)=0;
beta(M)=0;
ritemp(M,2001)=0;
rqtemp(M,2001)=0;
rialpha(1,2001)=0;
fm=[1 10 100];
Wm=2*pi*fm;
for i=1:3
for n=1:1:M
for t=0:0.001:2
Wn(n)=Wm(i)*cos(2*pi*n/N);
beta(n)=pi*n/M;
ritemp(n,round(1000*t+1))=2*cos(beta(n))*cos(Wn(n)*t);
rqtemp(n,round(1000*t+1))=2*sin(beta(n))*cos(Wn(n)*t);
rialpha(1,round(1000*t+1))=2*cos(Wm(i)*t)/sqrt(2);
end
end
ri=sum(ritemp)+rialpha;
rq=sum(rqtemp);
r=sqrt(ri.^2+rq.^2);
mean=sum(r)/2001;
% subplot(3,1,i);
% plot(3,1)
time=0:0.001:2;
plot(time,(10*log10(r)-10*log10(mean)));
titlename=['fd= ' int2str(fm(i)) ' Hz'];
title(titlename);
xlabel('time(second)');
ylabel('Envelope(dB)');
pause
end
댓글 수: 2
Jianning Dong
2019년 4월 11일
I have the same problem here on Linux platform, matlab2019a. Some other functions in the graphics toolbox folder are missing as well.
답변 (2개)
Jianning Dong
2019년 4월 11일
Hi Masroor,
I tried to reset the PATH and rehah the toolbox. Now newplot is usable.
MATLAB moves some functions from the root of graphics folder to axis folder.
So if you update matlab from a previous version. You have to reset the path:
restoredefaultpath
rehash path
rehash toolbox
rehash toolboxcache
댓글 수: 2
daniel bourdon
2019년 6월 2일
I had the same error about variable 'newplot' with Matalb 2019a.
I just typed 'restoredefaultpath' in matlab command window and the plot functions run properly.
David Mellinger
2019년 6월 17일
'restoredefaultpath' worked for me as well. I had done the 'rehash' steps from above previously, which did not work, but possibly the combination of the two is needed.
Abdallah Ghazi Faisal Zaid Alkilani
2020년 3월 28일
I had a similar issue and I think the culprit is a function called newplot.m.
newplot.m function has subfunctions inside that were not terminated with 'end'.
I added an 'end' statement for each function inside newplot.m:
- function axReturn = newplot(hsave)
- function fig = ObserveFigureNextPlot(fig, hsave)
- function ax = ObserveAxesNextPlot(ax, hsave)
It has worked so far *fingers crossed*.
You can open the file to edit by typing >> open newplot;
I hope this helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!